From 9d82191cbce91918c5b445e87dcc03b06efe9ff0 Mon Sep 17 00:00:00 2001 From: Patrice Vignola Date: Sun, 23 Aug 2015 13:02:34 -0400 Subject: [PATCH] Character animation --- Assets/Prefabs/Child.prefab | 10 +++--- Assets/Prefabs/Kid_AnimControl.controller | 6 ++-- Assets/Scenes/PatScene.unity | 40 +++-------------------- Assets/Scripts/Child.cs | 6 ++++ 4 files changed, 18 insertions(+), 44 deletions(-) diff --git a/Assets/Prefabs/Child.prefab b/Assets/Prefabs/Child.prefab index 9c7e225..3691cf5 100644 --- a/Assets/Prefabs/Child.prefab +++ b/Assets/Prefabs/Child.prefab @@ -920,7 +920,7 @@ Transform: m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 190616} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: -2.3900001, y: .970000029, z: .25} + m_LocalPosition: {x: -2.02999997, y: .97299999, z: 2.27999997} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: - {fileID: 421634} @@ -1082,7 +1082,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: e6ffb35a11ff1f545ac22f7ea752cffb, type: 3} m_Name: m_EditorClassIdentifier: - PlayerNumber: 0 + PlayerNumber: 1 --- !u!114 &11474836 MonoBehaviour: m_ObjectHideFlags: 1 @@ -1117,7 +1117,7 @@ SphereCollider: m_IsTrigger: 1 m_Enabled: 1 serializedVersion: 2 - m_Radius: .75 + m_Radius: .519999981 m_Center: {x: 0, y: 0, z: 0} --- !u!136 &13685066 CapsuleCollider: @@ -1128,8 +1128,8 @@ CapsuleCollider: m_Material: {fileID: 0} m_IsTrigger: 0 m_Enabled: 1 - m_Radius: .5 - m_Height: 1 + m_Radius: .209999993 + m_Height: 1.00999999 m_Direction: 1 m_Center: {x: 0, y: 0, z: 0} --- !u!137 &13704276 diff --git a/Assets/Prefabs/Kid_AnimControl.controller b/Assets/Prefabs/Kid_AnimControl.controller index 8a1e2e5..fe32a51 100644 --- a/Assets/Prefabs/Kid_AnimControl.controller +++ b/Assets/Prefabs/Kid_AnimControl.controller @@ -14,7 +14,7 @@ AnimatorController: m_DefaultInt: 0 m_DefaultBool: 0 m_Controller: {fileID: 0} - - m_Name: start_attack + - m_Name: StartAttack m_Type: 9 m_DefaultFloat: 0 m_DefaultInt: 0 @@ -59,7 +59,7 @@ AnimatorStateTransition: m_Name: m_Conditions: - m_ConditionMode: 1 - m_ConditionEvent: start_attack + m_ConditionEvent: StartAttack m_EventTreshold: 0 m_DstStateMachine: {fileID: 0} m_DstState: {fileID: 110284670} @@ -434,7 +434,7 @@ AnimatorStateTransition: m_Name: m_Conditions: - m_ConditionMode: 1 - m_ConditionEvent: start_attack + m_ConditionEvent: StartAttack m_EventTreshold: 0 m_DstStateMachine: {fileID: 0} m_DstState: {fileID: 110284670} diff --git a/Assets/Scenes/PatScene.unity b/Assets/Scenes/PatScene.unity index 633ce1a..97eea8b 100644 --- a/Assets/Scenes/PatScene.unity +++ b/Assets/Scenes/PatScene.unity @@ -598,38 +598,6 @@ Prefab: propertyPath: Mom value: objectReference: {fileID: 1257411050} - - target: {fileID: 11446734, guid: 6dd661a967968c64dbae75c01fac6a09, type: 2} - propertyPath: PlayerNumber - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 11430644, guid: 6dd661a967968c64dbae75c01fac6a09, type: 2} - propertyPath: hitPushBackForce - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 13685066, guid: 6dd661a967968c64dbae75c01fac6a09, type: 2} - propertyPath: m_Material - value: - objectReference: {fileID: 0} - - target: {fileID: 11430644, guid: 6dd661a967968c64dbae75c01fac6a09, type: 2} - propertyPath: Speed - value: 2 - objectReference: {fileID: 0} - - target: {fileID: 5480620, guid: 6dd661a967968c64dbae75c01fac6a09, type: 2} - propertyPath: m_AngularDrag - value: .0500000007 - objectReference: {fileID: 0} - - target: {fileID: 11430644, guid: 6dd661a967968c64dbae75c01fac6a09, type: 2} - propertyPath: yAngleVector - value: 3 - objectReference: {fileID: 0} - - target: {fileID: 5480620, guid: 6dd661a967968c64dbae75c01fac6a09, type: 2} - propertyPath: m_Mass - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 11430644, guid: 6dd661a967968c64dbae75c01fac6a09, type: 2} - propertyPath: JumpForce - value: 200 - objectReference: {fileID: 0} m_RemovedComponents: [] m_ParentPrefab: {fileID: 100100000, guid: 6dd661a967968c64dbae75c01fac6a09, type: 2} m_IsPrefabParent: 0 @@ -1097,10 +1065,6 @@ Prefab: propertyPath: m_RootOrder value: 2 objectReference: {fileID: 0} - - target: {fileID: 6472040, guid: 0839912c1546d474686e48f2f1ea76fe, type: 2} - propertyPath: m_Material - value: - objectReference: {fileID: 0} m_RemovedComponents: [] m_ParentPrefab: {fileID: 100100000, guid: 0839912c1546d474686e48f2f1ea76fe, type: 2} m_IsPrefabParent: 0 @@ -2554,6 +2518,10 @@ Prefab: propertyPath: Mom value: objectReference: {fileID: 1257411050} + - target: {fileID: 11446734, guid: 6dd661a967968c64dbae75c01fac6a09, type: 2} + propertyPath: PlayerNumber + value: 0 + objectReference: {fileID: 0} m_RemovedComponents: [] m_ParentPrefab: {fileID: 100100000, guid: 6dd661a967968c64dbae75c01fac6a09, type: 2} m_IsPrefabParent: 0 diff --git a/Assets/Scripts/Child.cs b/Assets/Scripts/Child.cs index 6d739c0..d458d8b 100644 --- a/Assets/Scripts/Child.cs +++ b/Assets/Scripts/Child.cs @@ -24,6 +24,7 @@ public class Child : MonoBehaviour private float _invulnerableTime; private Bed _currentBed; public Transform target; + private bool _isInLava; private int _index; private bool _isPushed = false; @@ -186,6 +187,7 @@ public class Child : MonoBehaviour } internal void Throw() { + if (_isInLava) return; if (pillow != null) { @@ -205,6 +207,8 @@ public class Child : MonoBehaviour pillow.IsOwned = false; pillow = null; + + Animator.SetTrigger("StartAttack"); } } @@ -217,6 +221,7 @@ public class Child : MonoBehaviour TakeLavaDamage(); ActivateVibration(true); Animator.SetBool("IsOnLava", true); + _isInLava = true; } else { @@ -236,6 +241,7 @@ public class Child : MonoBehaviour { ActivateVibration(false); Animator.SetBool("IsOnLava", false); + _isInLava = false; } }