diff --git a/Assets/Animations/PlayerAnimations/Player1/PlayerAnimations1.controller b/Assets/Animations/PlayerAnimations/Player1/PlayerAnimations1.controller index eb949a1..8c1b4ea 100644 --- a/Assets/Animations/PlayerAnimations/Player1/PlayerAnimations1.controller +++ b/Assets/Animations/PlayerAnimations/Player1/PlayerAnimations1.controller @@ -47,7 +47,7 @@ AnimatorStateTransition: m_TransitionOffset: 0 m_ExitTime: 0.75 m_HasExitTime: 0 - m_HasFixedDuration: 0 + m_HasFixedDuration: 1 m_InterruptionSource: 0 m_OrderedInterruption: 1 m_CanTransitionToSelf: 1 @@ -85,7 +85,7 @@ AnimatorStateMachine: m_EntryTransitions: [] m_StateMachineTransitions: {} m_StateMachineBehaviours: [] - m_AnyStatePosition: {x: 280, y: 90, z: 0} + m_AnyStatePosition: {x: 300, y: 70, 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} @@ -111,7 +111,7 @@ AnimatorStateTransition: m_TransitionOffset: 0 m_ExitTime: 0.75 m_HasExitTime: 0 - m_HasFixedDuration: 0 + m_HasFixedDuration: 1 m_InterruptionSource: 0 m_OrderedInterruption: 1 m_CanTransitionToSelf: 1 @@ -136,7 +136,7 @@ AnimatorStateTransition: m_TransitionOffset: 0 m_ExitTime: 0.75 m_HasExitTime: 0 - m_HasFixedDuration: 0 + m_HasFixedDuration: 1 m_InterruptionSource: 0 m_OrderedInterruption: 1 m_CanTransitionToSelf: 1 @@ -265,7 +265,7 @@ AnimatorStateTransition: m_TransitionOffset: 0 m_ExitTime: 0.75 m_HasExitTime: 0 - m_HasFixedDuration: 0 + m_HasFixedDuration: 1 m_InterruptionSource: 0 m_OrderedInterruption: 1 m_CanTransitionToSelf: 1 @@ -290,7 +290,7 @@ AnimatorStateTransition: m_TransitionOffset: 0 m_ExitTime: 0.75 m_HasExitTime: 0 - m_HasFixedDuration: 0 + m_HasFixedDuration: 1 m_InterruptionSource: 0 m_OrderedInterruption: 1 m_CanTransitionToSelf: 1 diff --git a/Assets/Animations/PlayerAnimations/Player2/PlayerAnimations2.controller b/Assets/Animations/PlayerAnimations/Player2/PlayerAnimations2.controller index 71c3d25..c52c14e 100644 --- a/Assets/Animations/PlayerAnimations/Player2/PlayerAnimations2.controller +++ b/Assets/Animations/PlayerAnimations/Player2/PlayerAnimations2.controller @@ -129,31 +129,31 @@ AnimatorController: m_DefaultFloat: 0 m_DefaultInt: 0 m_DefaultBool: 0 - m_Controller: {fileID: 0} + m_Controller: {fileID: 9100000} - m_Name: Run m_Type: 9 m_DefaultFloat: 0 m_DefaultInt: 0 m_DefaultBool: 0 - m_Controller: {fileID: 0} + m_Controller: {fileID: 9100000} - m_Name: Mop m_Type: 9 m_DefaultFloat: 0 m_DefaultInt: 0 m_DefaultBool: 0 - m_Controller: {fileID: 0} + m_Controller: {fileID: 9100000} - m_Name: Swing m_Type: 9 m_DefaultFloat: 0 m_DefaultInt: 0 m_DefaultBool: 0 - m_Controller: {fileID: 0} + m_Controller: {fileID: 9100000} - m_Name: RunMop m_Type: 9 m_DefaultFloat: 0 m_DefaultInt: 0 m_DefaultBool: 0 - m_Controller: {fileID: 0} + m_Controller: {fileID: 9100000} m_AnimatorLayers: - serializedVersion: 5 m_Name: Base Layer diff --git a/Assets/Scripts/Controller/RumbleManager.cs b/Assets/Scripts/Controller/RumbleManager.cs index 434ae9d..f801e27 100644 --- a/Assets/Scripts/Controller/RumbleManager.cs +++ b/Assets/Scripts/Controller/RumbleManager.cs @@ -5,20 +5,19 @@ using UnityEngine.InputSystem; public class RumbleManager : MonoBehaviour { - private Gamepad pad1; - private Gamepad pad2; + private Gamepad pad; private Coroutine stopRumbleAfterTimeCorutine; public void RumblePulse(float lowFrequency, float highFrequency, float duration, int player) { - pad1 = Gamepad.all[0]; - if (pad1 != null) + pad = Gamepad.all[player]; + if (pad != null) { - pad1.SetMotorSpeeds(lowFrequency, highFrequency); + pad.SetMotorSpeeds(lowFrequency, highFrequency); - stopRumbleAfterTimeCorutine = StartCoroutine(stopRumble(duration, pad1)); + stopRumbleAfterTimeCorutine = StartCoroutine(stopRumble(duration, pad)); } } diff --git a/Assets/Scripts/Player/PlayerMovement.cs b/Assets/Scripts/Player/PlayerMovement.cs index 090576c..93d0a5c 100644 --- a/Assets/Scripts/Player/PlayerMovement.cs +++ b/Assets/Scripts/Player/PlayerMovement.cs @@ -52,7 +52,10 @@ public class PlayerMovement : MonoBehaviour movement.y = Input.GetAxisRaw("Vertical"); ; } if (movement.x != 0 || movement.y != 0) + { RumbleWalk(); + GetComponent().Run(); + } } private void FixedUpdate() {