diff --git a/Assets/Animations/PlayerAnimations/Player1/PlayerAnimations1.controller b/Assets/Animations/PlayerAnimations/Player1/PlayerAnimations1.controller index 35551f0..eb949a1 100644 --- a/Assets/Animations/PlayerAnimations/Player1/PlayerAnimations1.controller +++ b/Assets/Animations/PlayerAnimations/Player1/PlayerAnimations1.controller @@ -62,7 +62,7 @@ AnimatorStateMachine: m_ChildStates: - serializedVersion: 1 m_State: {fileID: 9123080415032741332} - m_Position: {x: 40, y: 70, z: 0} + m_Position: {x: 30, y: 40, z: 0} - serializedVersion: 1 m_State: {fileID: 548892628922324246} m_Position: {x: 570, y: 80, z: 0} @@ -85,7 +85,7 @@ AnimatorStateMachine: m_EntryTransitions: [] m_StateMachineTransitions: {} m_StateMachineBehaviours: [] - m_AnyStatePosition: {x: 300, y: 80, z: 0} + m_AnyStatePosition: {x: 280, y: 90, z: 0} m_EntryPosition: {x: 20, y: 160, z: 0} m_ExitPosition: {x: 800, y: 120, z: 0} m_ParentStateMachinePosition: {x: 800, y: 20, z: 0} @@ -150,31 +150,31 @@ AnimatorController: serializedVersion: 5 m_AnimatorParameters: - m_Name: Idle - m_Type: 4 - m_DefaultFloat: 0 - m_DefaultInt: 0 - m_DefaultBool: 0 - m_Controller: {fileID: 0} - - m_Name: Mop - m_Type: 4 - m_DefaultFloat: 0 - m_DefaultInt: 0 - m_DefaultBool: 0 - m_Controller: {fileID: 0} - - m_Name: RunMop - m_Type: 4 + m_Type: 9 m_DefaultFloat: 0 m_DefaultInt: 0 m_DefaultBool: 0 m_Controller: {fileID: 0} - m_Name: Run - m_Type: 4 + m_Type: 9 + m_DefaultFloat: 0 + m_DefaultInt: 0 + m_DefaultBool: 0 + m_Controller: {fileID: 0} + - m_Name: Mop + m_Type: 9 + m_DefaultFloat: 0 + m_DefaultInt: 0 + m_DefaultBool: 0 + m_Controller: {fileID: 0} + - m_Name: RunMop + m_Type: 9 m_DefaultFloat: 0 m_DefaultInt: 0 m_DefaultBool: 0 m_Controller: {fileID: 0} - m_Name: Swing - m_Type: 4 + m_Type: 9 m_DefaultFloat: 0 m_DefaultInt: 0 m_DefaultBool: 0 diff --git a/Assets/Resources/Player.prefab b/Assets/Resources/Player1.prefab similarity index 94% rename from Assets/Resources/Player.prefab rename to Assets/Resources/Player1.prefab index 8806893..0bfdcb7 100644 --- a/Assets/Resources/Player.prefab +++ b/Assets/Resources/Player1.prefab @@ -186,8 +186,9 @@ GameObject: - component: {fileID: 3086165646112058191} - component: {fileID: 1508323898269695585} - component: {fileID: 5467488512035376674} + - component: {fileID: 3878447480781341932} m_Layer: 7 - m_Name: Player + m_Name: Player1 m_TagString: Player m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -289,3 +290,15 @@ MonoBehaviour: anchor: {fileID: 1170758327458850867} body: {fileID: 1508323898269695585} locked: 0 +--- !u!114 &3878447480781341932 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3120938410244321186} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 9c2ddf673a65d3d49bc9470e1a4572e4, type: 3} + m_Name: + m_EditorClassIdentifier: diff --git a/Assets/Resources/Player.prefab.meta b/Assets/Resources/Player1.prefab.meta similarity index 100% rename from Assets/Resources/Player.prefab.meta rename to Assets/Resources/Player1.prefab.meta diff --git a/Assets/Scenes/MovementTest.unity b/Assets/Scenes/MovementTest.unity index 4b3bc04..7f19342 100644 --- a/Assets/Scenes/MovementTest.unity +++ b/Assets/Scenes/MovementTest.unity @@ -1924,7 +1924,7 @@ PrefabInstance: m_Modifications: - target: {fileID: 320690117028550720, guid: 99a6ff8b9591949439b620b13bd249a4, type: 3} propertyPath: m_LocalPosition.x - value: 0 + value: -16.65 objectReference: {fileID: 0} - target: {fileID: 320690117028550720, guid: 99a6ff8b9591949439b620b13bd249a4, type: 3} propertyPath: m_LocalPosition.y diff --git a/Assets/Scripts/Player/PlayerAnimationHandler.cs b/Assets/Scripts/Player/PlayerAnimationHandler.cs index 4394f65..d131f57 100644 --- a/Assets/Scripts/Player/PlayerAnimationHandler.cs +++ b/Assets/Scripts/Player/PlayerAnimationHandler.cs @@ -10,33 +10,24 @@ public class PlayerAnimationHandler : MonoBehaviour animator = GetComponentInChildren(); } - void Update() + public void Idle() { - if (Input.GetKeyDown(KeyCode.I)) - Idle(true); - if (Input.GetKeyDown(KeyCode.Space)) - Mop(true); - if (Input.GetKeyDown(KeyCode.R)) - Run(true); + animator.SetTrigger("Idle"); } - public void Idle(bool active) + public void Run() { - animator.SetBool("Idle", active); + animator.SetTrigger("Run"); } - public void Run(bool active) + public void Swing() { - animator.SetBool("Run", active); + animator.SetTrigger("Swing"); } - public void Swing(bool active) + public void Mop() { - animator.SetBool("Swing",active); + animator.SetTrigger("Mop"); } - public void Mop(bool active) + public void RunMop() { - animator.SetBool("Mop", active); - } - public void RunMop(bool active) - { - animator.SetBool("RunMop", active); + animator.SetTrigger("RunMop"); } }