Skip to content

Commit

Permalink
Fix animations, sync shot time with animation
Browse files Browse the repository at this point in the history
  • Loading branch information
BabichMikhail committed May 10, 2018
1 parent a0572ed commit d8f248a
Show file tree
Hide file tree
Showing 7 changed files with 131 additions and 13 deletions.
1 change: 1 addition & 0 deletions Assets/Resources/scripts/MainController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ private void Update()

// time in milliseconds, unit count, respawn index
private List<MyIntTuple> sendUnits = new List<MyIntTuple>() {
new MyIntTuple(1, 1, 2),
new MyIntTuple(3000, 2, 0),
new MyIntTuple(23000, 1, 1),
new MyIntTuple(24000, 1, 2),
Expand Down
1 change: 0 additions & 1 deletion Assets/Resources/scripts/UnitController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ public void Update()

private void ShootAtTower()
{
gameObject.transform.LookAt(targetTower.transform);
if (!hitted) {
Animation.TryAnimate(gameObject, "Hit");
hitted = true;
Expand Down
2 changes: 1 addition & 1 deletion Assets/Resources/units/Easy boi prefab.prefab
Original file line number Diff line number Diff line change
Expand Up @@ -1468,7 +1468,7 @@ NavMeshAgent:
avoidancePriority: 50
m_AngularSpeed: 120
m_StoppingDistance: 0
m_AutoTraverseOffMeshLink: 1
m_AutoTraverseOffMeshLink: 0
m_AutoBraking: 1
m_AutoRepath: 1
m_Height: 2
Expand Down
14 changes: 7 additions & 7 deletions Assets/Resources/units/Ifying_boi.controller
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,9 @@ AnimatorStateTransition:
m_Mute: 0
m_IsExit: 0
serializedVersion: 3
m_TransitionDuration: 0.25
m_TransitionOffset: 0.04674696
m_ExitTime: 0.7931034
m_TransitionDuration: 0.34443438
m_TransitionOffset: 1.793425
m_ExitTime: 0
m_HasExitTime: 1
m_HasFixedDuration: 1
m_InterruptionSource: 0
Expand All @@ -124,10 +124,10 @@ AnimatorStateTransition:
m_Mute: 0
m_IsExit: 0
serializedVersion: 3
m_TransitionDuration: 0.25
m_TransitionOffset: 0
m_ExitTime: 0.875
m_HasExitTime: 0
m_TransitionDuration: 0.65514004
m_TransitionOffset: 0.0064478666
m_ExitTime: 0.66074324
m_HasExitTime: 1
m_HasFixedDuration: 1
m_InterruptionSource: 0
m_OrderedInterruption: 1
Expand Down
2 changes: 1 addition & 1 deletion Assets/Resources/units/lfying_boi.prefab
Original file line number Diff line number Diff line change
Expand Up @@ -1282,7 +1282,7 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
health: 800
fireInterval: 1000
fireInterval: 1208
attackRadius: 4
damage: 100
type: 0
Expand Down
124 changes: 121 additions & 3 deletions Assets/main.unity
Original file line number Diff line number Diff line change
Expand Up @@ -2382,6 +2382,91 @@ MeshFilter:
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 403966300}
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
--- !u!1 &439201513
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 5
m_Component:
- component: {fileID: 439201514}
- component: {fileID: 439201517}
- component: {fileID: 439201516}
- component: {fileID: 439201515}
m_Layer: 0
m_Name: Sphere
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 8
m_IsActive: 1
--- !u!4 &439201514
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 439201513}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -8.64, y: 1.2, z: 51.86}
m_LocalScale: {x: 12, y: 12, z: 12}
m_Children: []
m_Father: {fileID: 1674194214}
m_RootOrder: 14
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!135 &439201515
SphereCollider:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 439201513}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Radius: 0.5
m_Center: {x: 0, y: 0, z: 0}
--- !u!23 &439201516
MeshRenderer:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 439201513}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 4294967295
m_Materials:
- {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 0
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!33 &439201517
MeshFilter:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 439201513}
m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0}
--- !u!1 &455555819
GameObject:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -2880,7 +2965,7 @@ Transform:
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 510838579}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 1.069, y: 7.95, z: 7.295}
m_LocalPosition: {x: 1.415, y: 7.95, z: 7.315}
m_LocalScale: {x: 0.1, y: 0.1, z: 0.1}
m_Children: []
m_Father: {fileID: 2011274162}
Expand Down Expand Up @@ -3546,7 +3631,7 @@ Prefab:
objectReference: {fileID: 0}
- target: {fileID: 400000, guid: 20c18f3333473164cb8fe39527a56fda, type: 3}
propertyPath: m_LocalPosition.y
value: 2.7900002
value: 2.79
objectReference: {fileID: 0}
- target: {fileID: 400000, guid: 20c18f3333473164cb8fe39527a56fda, type: 3}
propertyPath: m_LocalPosition.z
Expand Down Expand Up @@ -4199,6 +4284,10 @@ Prefab:
propertyPath: m_Materials.Array.data[0]
value:
objectReference: {fileID: 2100000, guid: e1b757f6a1670044e95239f25aecfbe7, type: 2}
- target: {fileID: 100000, guid: fa9748fd8101d6341b8eebff37474ab3, type: 3}
propertyPath: m_StaticEditorFlags
value: 40
objectReference: {fileID: 0}
m_RemovedComponents: []
m_ParentPrefab: {fileID: 100100000, guid: fa9748fd8101d6341b8eebff37474ab3, type: 3}
m_IsPrefabParent: 0
Expand Down Expand Up @@ -8956,6 +9045,34 @@ Prefab:
propertyPath: m_LocalPosition.z
value: -2.25
objectReference: {fileID: 0}
- target: {fileID: 1973025387509430, guid: 6bd9a3d57b341484ead2f4ac1f52c74a, type: 2}
propertyPath: m_StaticEditorFlags
value: 40
objectReference: {fileID: 0}
- target: {fileID: 1966835180879152, guid: 6bd9a3d57b341484ead2f4ac1f52c74a, type: 2}
propertyPath: m_StaticEditorFlags
value: 40
objectReference: {fileID: 0}
- target: {fileID: 1731179463996704, guid: 6bd9a3d57b341484ead2f4ac1f52c74a, type: 2}
propertyPath: m_StaticEditorFlags
value: 40
objectReference: {fileID: 0}
- target: {fileID: 1992584076261068, guid: 6bd9a3d57b341484ead2f4ac1f52c74a, type: 2}
propertyPath: m_StaticEditorFlags
value: 40
objectReference: {fileID: 0}
- target: {fileID: 1349617542444228, guid: 6bd9a3d57b341484ead2f4ac1f52c74a, type: 2}
propertyPath: m_StaticEditorFlags
value: 40
objectReference: {fileID: 0}
- target: {fileID: 1222636906483568, guid: 6bd9a3d57b341484ead2f4ac1f52c74a, type: 2}
propertyPath: m_StaticEditorFlags
value: 40
objectReference: {fileID: 0}
- target: {fileID: 1457080302086154, guid: 6bd9a3d57b341484ead2f4ac1f52c74a, type: 2}
propertyPath: m_StaticEditorFlags
value: 40
objectReference: {fileID: 0}
m_RemovedComponents: []
m_ParentPrefab: {fileID: 100100000, guid: 6bd9a3d57b341484ead2f4ac1f52c74a, type: 2}
m_IsPrefabParent: 0
Expand Down Expand Up @@ -9106,7 +9223,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
m_IsActive: 1
--- !u!4 &1674194214
Transform:
m_ObjectHideFlags: 0
Expand All @@ -9131,6 +9248,7 @@ Transform:
- {fileID: 1373249550}
- {fileID: 34233296}
- {fileID: 1838361110}
- {fileID: 439201514}
m_Father: {fileID: 1150578338}
m_RootOrder: 7
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
Expand Down
Binary file modified Assets/main/NavMesh.asset
Binary file not shown.

0 comments on commit d8f248a

Please sign in to comment.