From f7e086424d849609c5f277d0ff678db891284093 Mon Sep 17 00:00:00 2001 From: Bruno Rodrigues Faria Date: Thu, 1 Sep 2022 00:36:36 -0300 Subject: [PATCH] =?UTF-8?q?anima=C3=A7=C3=A3o=20andar=20e=20ausente=20-=20?= =?UTF-8?q?melhorar=20a=20questao=20de=20ticks=20para=20zero?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DogKnight/Animator/DogControl.controller | 590 +++--------------- Assets/Scenes/MainScene.unity | 30 +- Assets/Scripts/PlayerScript.cs | 6 +- 3 files changed, 111 insertions(+), 515 deletions(-) diff --git a/Assets/DogKnight/Animator/DogControl.controller b/Assets/DogKnight/Animator/DogControl.controller index cc64dfa..6d3d9f4 100644 --- a/Assets/DogKnight/Animator/DogControl.controller +++ b/Assets/DogKnight/Animator/DogControl.controller @@ -1,464 +1,136 @@ %YAML 1.1 %TAG !u! tag:unity3d.com,2011: ---- !u!91 &9100000 -AnimatorController: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_Name: DogControl - serializedVersion: 5 - m_AnimatorParameters: [] - m_AnimatorLayers: - - serializedVersion: 5 - m_Name: Base Layer - m_StateMachine: {fileID: 1107905649089028422} - m_Mask: {fileID: 0} - m_Motions: [] - m_Behaviours: [] - m_BlendingMode: 0 - m_SyncedLayerIndex: -1 - m_DefaultWeight: 0 - m_IKPass: 0 - m_SyncedLayerAffectsTiming: 0 - m_Controller: {fileID: 9100000} ---- !u!1101 &1101025243568558234 -AnimatorStateTransition: - m_ObjectHideFlags: 1 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_Name: - m_Conditions: [] - m_DstStateMachine: {fileID: 0} - m_DstState: {fileID: 1102689691343913632} - m_Solo: 0 - m_Mute: 0 - m_IsExit: 0 - serializedVersion: 3 - m_TransitionDuration: 0.2 - m_TransitionOffset: 0 - m_ExitTime: 1 - m_HasExitTime: 1 - m_HasFixedDuration: 1 - m_InterruptionSource: 0 - m_OrderedInterruption: 1 - m_CanTransitionToSelf: 1 ---- !u!1101 &1101072195810957972 -AnimatorStateTransition: - m_ObjectHideFlags: 1 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_Name: - m_Conditions: [] - m_DstStateMachine: {fileID: 0} - m_DstState: {fileID: 1102381193985536354} - m_Solo: 0 - m_Mute: 0 - m_IsExit: 0 - serializedVersion: 3 - m_TransitionDuration: 0.25 - m_TransitionOffset: 0 - m_ExitTime: 3 - m_HasExitTime: 1 - m_HasFixedDuration: 1 - m_InterruptionSource: 0 - m_OrderedInterruption: 1 - m_CanTransitionToSelf: 1 ---- !u!1101 &1101141846149638978 -AnimatorStateTransition: - m_ObjectHideFlags: 1 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_Name: - m_Conditions: [] - m_DstStateMachine: {fileID: 0} - m_DstState: {fileID: 1102201852766415110} - m_Solo: 0 - m_Mute: 0 - m_IsExit: 0 - serializedVersion: 3 - m_TransitionDuration: 0 - m_TransitionOffset: 0 - m_ExitTime: 3 - m_HasExitTime: 1 - m_HasFixedDuration: 1 - m_InterruptionSource: 0 - m_OrderedInterruption: 1 - m_CanTransitionToSelf: 1 ---- !u!1101 &1101494123869838964 -AnimatorStateTransition: - m_ObjectHideFlags: 1 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_Name: - m_Conditions: [] - m_DstStateMachine: {fileID: 0} - m_DstState: {fileID: 1102978981160464930} - m_Solo: 0 - m_Mute: 0 - m_IsExit: 0 - serializedVersion: 3 - m_TransitionDuration: 0.11524987 - m_TransitionOffset: 0 - m_ExitTime: 3.8331482 - m_HasExitTime: 1 - m_HasFixedDuration: 1 - m_InterruptionSource: 0 - m_OrderedInterruption: 1 - m_CanTransitionToSelf: 1 ---- !u!1101 &1101643552029966614 -AnimatorStateTransition: - m_ObjectHideFlags: 1 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_Name: - m_Conditions: [] - m_DstStateMachine: {fileID: 0} - m_DstState: {fileID: 1102503426251137486} - m_Solo: 0 - m_Mute: 0 - m_IsExit: 0 - serializedVersion: 3 - m_TransitionDuration: 0.25 - m_TransitionOffset: 0 - m_ExitTime: 3 - m_HasExitTime: 1 - m_HasFixedDuration: 1 - m_InterruptionSource: 0 - m_OrderedInterruption: 1 - m_CanTransitionToSelf: 1 ---- !u!1101 &1101676475510292630 -AnimatorStateTransition: +--- !u!1102 &-4667079754632247672 +AnimatorState: + serializedVersion: 6 m_ObjectHideFlags: 1 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_Name: - m_Conditions: [] - m_DstStateMachine: {fileID: 0} - m_DstState: {fileID: 1102494443745526630} - m_Solo: 0 - m_Mute: 0 - m_IsExit: 0 - serializedVersion: 3 - m_TransitionDuration: 0.2 - m_TransitionOffset: 0 - m_ExitTime: 3 - m_HasExitTime: 1 - m_HasFixedDuration: 1 - m_InterruptionSource: 0 - m_OrderedInterruption: 1 - m_CanTransitionToSelf: 1 ---- !u!1101 &1101807178245991928 + m_Name: Idle_Battle + m_Speed: 1 + m_CycleOffset: 0 + m_Transitions: + - {fileID: 1239122277720764992} + m_StateMachineBehaviours: [] + m_Position: {x: 50, y: 50, z: 0} + m_IKOnFeet: 0 + m_WriteDefaultValues: 1 + m_Mirror: 0 + m_SpeedParameterActive: 0 + m_MirrorParameterActive: 0 + m_CycleOffsetParameterActive: 0 + m_TimeParameterActive: 0 + m_Motion: {fileID: 7400000, guid: b79ff7bb68348be479d3db6b7fe8a569, type: 2} + m_Tag: + m_SpeedParameter: speed + m_MirrorParameter: + m_CycleOffsetParameter: + m_TimeParameter: +--- !u!1101 &-4213088508242333514 AnimatorStateTransition: m_ObjectHideFlags: 1 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: - m_Conditions: [] + m_Conditions: + - m_ConditionMode: 4 + m_ConditionEvent: speed + m_EventTreshold: 0.5 m_DstStateMachine: {fileID: 0} - m_DstState: {fileID: 1102851807468560652} + m_DstState: {fileID: -4667079754632247672} m_Solo: 0 m_Mute: 0 m_IsExit: 0 serializedVersion: 3 - m_TransitionDuration: 0.25 + m_TransitionDuration: 0.35447717 m_TransitionOffset: 0 - m_ExitTime: 4 - m_HasExitTime: 1 + m_ExitTime: 0.48115683 + m_HasExitTime: 0 m_HasFixedDuration: 1 m_InterruptionSource: 0 m_OrderedInterruption: 1 m_CanTransitionToSelf: 1 ---- !u!1101 &1101912574661031958 -AnimatorStateTransition: - m_ObjectHideFlags: 1 +--- !u!91 &9100000 +AnimatorController: + m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_Name: - m_Conditions: [] - m_DstStateMachine: {fileID: 0} - m_DstState: {fileID: 1102031868726192584} - m_Solo: 0 - m_Mute: 0 - m_IsExit: 0 - serializedVersion: 3 - m_TransitionDuration: 0.25 - m_TransitionOffset: 0 - m_ExitTime: 8 - m_HasExitTime: 1 - m_HasFixedDuration: 1 - m_InterruptionSource: 0 - m_OrderedInterruption: 1 - m_CanTransitionToSelf: 1 ---- !u!1101 &1101969349459206822 -AnimatorStateTransition: + m_Name: DogControl + serializedVersion: 5 + m_AnimatorParameters: + - m_Name: speed + m_Type: 1 + m_DefaultFloat: 0 + m_DefaultInt: 0 + m_DefaultBool: 0 + m_Controller: {fileID: 0} + m_AnimatorLayers: + - serializedVersion: 5 + m_Name: Base Layer + m_StateMachine: {fileID: 1107905649089028422} + m_Mask: {fileID: 0} + m_Motions: [] + m_Behaviours: [] + m_BlendingMode: 0 + m_SyncedLayerIndex: -1 + m_DefaultWeight: 0 + m_IKPass: 0 + m_SyncedLayerAffectsTiming: 0 + m_Controller: {fileID: 9100000} +--- !u!1107 &1107905649089028422 +AnimatorStateMachine: + serializedVersion: 6 m_ObjectHideFlags: 1 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_Name: - m_Conditions: [] - m_DstStateMachine: {fileID: 0} - m_DstState: {fileID: 1102597142297889830} - m_Solo: 0 - m_Mute: 0 - m_IsExit: 0 - serializedVersion: 3 - m_TransitionDuration: 0 - m_TransitionOffset: 0 - m_ExitTime: 4 - m_HasExitTime: 1 - m_HasFixedDuration: 1 - m_InterruptionSource: 0 - m_OrderedInterruption: 1 - m_CanTransitionToSelf: 1 ---- !u!1101 &1101985218390737874 + m_Name: Base Layer + m_ChildStates: + - serializedVersion: 1 + m_State: {fileID: -4667079754632247672} + m_Position: {x: 150, y: 280, z: 0} + - serializedVersion: 1 + m_State: {fileID: 8179308654072781915} + m_Position: {x: 520, y: 90, z: 0} + m_ChildStateMachines: [] + m_AnyStateTransitions: [] + m_EntryTransitions: [] + m_StateMachineTransitions: {} + m_StateMachineBehaviours: [] + m_AnyStatePosition: {x: 50, y: 20, z: 0} + m_EntryPosition: {x: 50, y: 120, z: 0} + m_ExitPosition: {x: 48, y: -132, z: 0} + m_ParentStateMachinePosition: {x: 800, y: 20, z: 0} + m_DefaultState: {fileID: -4667079754632247672} +--- !u!1101 &1239122277720764992 AnimatorStateTransition: m_ObjectHideFlags: 1 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: - m_Conditions: [] + m_Conditions: + - m_ConditionMode: 3 + m_ConditionEvent: speed + m_EventTreshold: 0.5 m_DstStateMachine: {fileID: 0} - m_DstState: {fileID: 1102841285716856984} + m_DstState: {fileID: 8179308654072781915} m_Solo: 0 m_Mute: 0 m_IsExit: 0 serializedVersion: 3 - m_TransitionDuration: 0 - m_TransitionOffset: 0 - m_ExitTime: 4 - m_HasExitTime: 1 + m_TransitionDuration: 0.32661694 + m_TransitionOffset: 0.13843298 + m_ExitTime: 0.63134336 + m_HasExitTime: 0 m_HasFixedDuration: 1 m_InterruptionSource: 0 m_OrderedInterruption: 1 m_CanTransitionToSelf: 1 ---- !u!1102 &1102031868726192584 -AnimatorState: - serializedVersion: 6 - m_ObjectHideFlags: 1 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_Name: Idle_Battle - m_Speed: 1 - m_CycleOffset: 0 - m_Transitions: - - {fileID: 1101969349459206822} - m_StateMachineBehaviours: [] - m_Position: {x: 50, y: 50, z: 0} - m_IKOnFeet: 0 - m_WriteDefaultValues: 1 - m_Mirror: 0 - m_SpeedParameterActive: 0 - m_MirrorParameterActive: 0 - m_CycleOffsetParameterActive: 0 - m_TimeParameterActive: 0 - m_Motion: {fileID: 7400000, guid: b79ff7bb68348be479d3db6b7fe8a569, type: 2} - m_Tag: - m_SpeedParameter: - m_MirrorParameter: - m_CycleOffsetParameter: - m_TimeParameter: ---- !u!1102 &1102201852766415110 -AnimatorState: - serializedVersion: 6 - m_ObjectHideFlags: 1 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_Name: DieRecover - m_Speed: 1 - m_CycleOffset: 0 - m_Transitions: - - {fileID: 1101025243568558234} - m_StateMachineBehaviours: [] - m_Position: {x: 50, y: 50, z: 0} - m_IKOnFeet: 0 - m_WriteDefaultValues: 1 - m_Mirror: 0 - m_SpeedParameterActive: 0 - m_MirrorParameterActive: 0 - m_CycleOffsetParameterActive: 0 - m_TimeParameterActive: 0 - m_Motion: {fileID: 7400000, guid: 4a3671dbe6670524b8b6d9ad3664c179, type: 2} - m_Tag: - m_SpeedParameter: - m_MirrorParameter: - m_CycleOffsetParameter: - m_TimeParameter: ---- !u!1102 &1102381193985536354 -AnimatorState: - serializedVersion: 6 - m_ObjectHideFlags: 1 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_Name: Dizzy - m_Speed: 1 - m_CycleOffset: 0 - m_Transitions: - - {fileID: 1101643552029966614} - m_StateMachineBehaviours: [] - m_Position: {x: 50, y: 50, z: 0} - m_IKOnFeet: 0 - m_WriteDefaultValues: 1 - m_Mirror: 0 - m_SpeedParameterActive: 0 - m_MirrorParameterActive: 0 - m_CycleOffsetParameterActive: 0 - m_TimeParameterActive: 0 - m_Motion: {fileID: 7400000, guid: 30d4fe7af77240a44b9354aaed8e5beb, type: 2} - m_Tag: - m_SpeedParameter: - m_MirrorParameter: - m_CycleOffsetParameter: - m_TimeParameter: ---- !u!1102 &1102494443745526630 -AnimatorState: - serializedVersion: 6 - m_ObjectHideFlags: 1 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_Name: GetHit - m_Speed: 1 - m_CycleOffset: 0 - m_Transitions: - - {fileID: 1101072195810957972} - m_StateMachineBehaviours: [] - m_Position: {x: 50, y: 50, z: 0} - m_IKOnFeet: 0 - m_WriteDefaultValues: 1 - m_Mirror: 0 - m_SpeedParameterActive: 0 - m_MirrorParameterActive: 0 - m_CycleOffsetParameterActive: 0 - m_TimeParameterActive: 0 - m_Motion: {fileID: 7400000, guid: 1588532e68f51a040bda71c68cfab177, type: 2} - m_Tag: - m_SpeedParameter: - m_MirrorParameter: - m_CycleOffsetParameter: - m_TimeParameter: ---- !u!1102 &1102503426251137486 -AnimatorState: - serializedVersion: 6 - m_ObjectHideFlags: 1 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_Name: Die - m_Speed: 1 - m_CycleOffset: 0 - m_Transitions: - - {fileID: 1101141846149638978} - m_StateMachineBehaviours: [] - m_Position: {x: 50, y: 50, z: 0} - m_IKOnFeet: 0 - m_WriteDefaultValues: 1 - m_Mirror: 0 - m_SpeedParameterActive: 0 - m_MirrorParameterActive: 0 - m_CycleOffsetParameterActive: 0 - m_TimeParameterActive: 0 - m_Motion: {fileID: 7400000, guid: 5d190d8211c88a64281f7b90c69f3eb3, type: 2} - m_Tag: - m_SpeedParameter: - m_MirrorParameter: - m_CycleOffsetParameter: - m_TimeParameter: ---- !u!1102 &1102597142297889830 -AnimatorState: - serializedVersion: 6 - m_ObjectHideFlags: 1 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_Name: Attack01 - m_Speed: 1.2 - m_CycleOffset: 0 - m_Transitions: - - {fileID: 1101985218390737874} - m_StateMachineBehaviours: [] - m_Position: {x: 50, y: 50, z: 0} - m_IKOnFeet: 0 - m_WriteDefaultValues: 1 - m_Mirror: 0 - m_SpeedParameterActive: 0 - m_MirrorParameterActive: 0 - m_CycleOffsetParameterActive: 0 - m_TimeParameterActive: 0 - m_Motion: {fileID: 7400000, guid: 6019f1b4a095b0b4396f5561a51fee89, type: 2} - m_Tag: - m_SpeedParameter: - m_MirrorParameter: - m_CycleOffsetParameter: - m_TimeParameter: ---- !u!1102 &1102689691343913632 -AnimatorState: - serializedVersion: 6 - m_ObjectHideFlags: 1 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_Name: WalkForwardBattle - m_Speed: 1.2 - m_CycleOffset: 0 - m_Transitions: - - {fileID: 1101807178245991928} - m_StateMachineBehaviours: [] - m_Position: {x: 50, y: 50, z: 0} - m_IKOnFeet: 0 - m_WriteDefaultValues: 1 - m_Mirror: 0 - m_SpeedParameterActive: 0 - m_MirrorParameterActive: 0 - m_CycleOffsetParameterActive: 0 - m_TimeParameterActive: 0 - m_Motion: {fileID: 7400000, guid: f0c8c1d913b359a428b42d53947d3e93, type: 2} - m_Tag: - m_SpeedParameter: - m_MirrorParameter: - m_CycleOffsetParameter: - m_TimeParameter: ---- !u!1102 &1102841285716856984 -AnimatorState: - serializedVersion: 6 - m_ObjectHideFlags: 1 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_Name: Attack02 - m_Speed: 1.2 - m_CycleOffset: 0 - m_Transitions: - - {fileID: 1101494123869838964} - m_StateMachineBehaviours: [] - m_Position: {x: 50, y: 50, z: 0} - m_IKOnFeet: 0 - m_WriteDefaultValues: 1 - m_Mirror: 0 - m_SpeedParameterActive: 0 - m_MirrorParameterActive: 0 - m_CycleOffsetParameterActive: 0 - m_TimeParameterActive: 0 - m_Motion: {fileID: 7400000, guid: eccbae3cfc77ad245ade46e143aa3200, type: 2} - m_Tag: - m_SpeedParameter: - m_MirrorParameter: - m_CycleOffsetParameter: - m_TimeParameter: ---- !u!1102 &1102851807468560652 +--- !u!1102 &8179308654072781915 AnimatorState: serializedVersion: 6 m_ObjectHideFlags: 1 @@ -466,98 +138,22 @@ AnimatorState: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: RunForwardBattle - m_Speed: 1.2 + m_Speed: 0.35 m_CycleOffset: 0 m_Transitions: - - {fileID: 1101912574661031958} + - {fileID: -4213088508242333514} m_StateMachineBehaviours: [] m_Position: {x: 50, y: 50, z: 0} m_IKOnFeet: 0 m_WriteDefaultValues: 1 m_Mirror: 0 - m_SpeedParameterActive: 0 + m_SpeedParameterActive: 1 m_MirrorParameterActive: 0 m_CycleOffsetParameterActive: 0 m_TimeParameterActive: 0 m_Motion: {fileID: 7400000, guid: 9f0e03164414016409d28995a128ba98, type: 2} m_Tag: - m_SpeedParameter: - m_MirrorParameter: - m_CycleOffsetParameter: - m_TimeParameter: ---- !u!1102 &1102978981160464930 -AnimatorState: - serializedVersion: 6 - m_ObjectHideFlags: 1 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_Name: Defend - m_Speed: 1 - m_CycleOffset: 0 - m_Transitions: - - {fileID: 1101676475510292630} - m_StateMachineBehaviours: [] - m_Position: {x: 50, y: 50, z: 0} - m_IKOnFeet: 0 - m_WriteDefaultValues: 1 - m_Mirror: 0 - m_SpeedParameterActive: 0 - m_MirrorParameterActive: 0 - m_CycleOffsetParameterActive: 0 - m_TimeParameterActive: 0 - m_Motion: {fileID: 7400000, guid: cf357b5409b4ad54a82c45d7684564e1, type: 2} - m_Tag: - m_SpeedParameter: + m_SpeedParameter: speed m_MirrorParameter: m_CycleOffsetParameter: m_TimeParameter: ---- !u!1107 &1107905649089028422 -AnimatorStateMachine: - serializedVersion: 6 - m_ObjectHideFlags: 1 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_Name: Base Layer - m_ChildStates: - - serializedVersion: 1 - m_State: {fileID: 1102031868726192584} - m_Position: {x: 216, y: -72, z: 0} - - serializedVersion: 1 - m_State: {fileID: 1102597142297889830} - m_Position: {x: 456, y: -72, z: 0} - - serializedVersion: 1 - m_State: {fileID: 1102841285716856984} - m_Position: {x: 456, y: 0, z: 0} - - serializedVersion: 1 - m_State: {fileID: 1102978981160464930} - m_Position: {x: 456, y: 72, z: 0} - - serializedVersion: 1 - m_State: {fileID: 1102494443745526630} - m_Position: {x: 456, y: 144, z: 0} - - serializedVersion: 1 - m_State: {fileID: 1102381193985536354} - m_Position: {x: 708, y: -72, z: 0} - - serializedVersion: 1 - m_State: {fileID: 1102503426251137486} - m_Position: {x: 708, y: 0, z: 0} - - serializedVersion: 1 - m_State: {fileID: 1102201852766415110} - m_Position: {x: 708, y: 72, z: 0} - - serializedVersion: 1 - m_State: {fileID: 1102851807468560652} - m_Position: {x: 708, y: 240, z: 0} - - serializedVersion: 1 - m_State: {fileID: 1102689691343913632} - m_Position: {x: 708, y: 144, z: 0} - m_ChildStateMachines: [] - m_AnyStateTransitions: [] - m_EntryTransitions: [] - m_StateMachineTransitions: {} - m_StateMachineBehaviours: [] - m_AnyStatePosition: {x: 50, y: 20, z: 0} - m_EntryPosition: {x: 50, y: 120, z: 0} - m_ExitPosition: {x: 48, y: -132, z: 0} - m_ParentStateMachinePosition: {x: 800, y: 20, z: 0} - m_DefaultState: {fileID: 1102031868726192584} diff --git a/Assets/Scenes/MainScene.unity b/Assets/Scenes/MainScene.unity index b147a11..781491c 100644 --- a/Assets/Scenes/MainScene.unity +++ b/Assets/Scenes/MainScene.unity @@ -38,7 +38,7 @@ RenderSettings: m_ReflectionIntensity: 1 m_CustomReflection: {fileID: 0} m_Sun: {fileID: 0} - m_IndirectSpecularColor: {r: 0.43470967, g: 0.4721343, b: 0.5098337, a: 1} + m_IndirectSpecularColor: {r: 0.44057134, g: 0.48920023, b: 0.569343, a: 1} m_UseRadianceAmbientProbe: 0 --- !u!157 &3 LightmapSettings: @@ -209,14 +209,14 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 23961099} - m_LocalRotation: {x: 0.079146475, y: -0.25794873, z: 0.02120723, w: 0.96267784} + m_LocalRotation: {x: 0.5411239, y: -0.17779137, z: 0.118280895, w: 0.8133787} m_LocalPosition: {x: 0, y: 3, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 0} m_RootOrder: 1 - m_LocalEulerAnglesHint: {x: 9.4, y: -30, z: 0} + m_LocalEulerAnglesHint: {x: 67.27, y: -24.66, z: 0} --- !u!1 &176817241 GameObject: m_ObjectHideFlags: 0 @@ -2451,7 +2451,7 @@ Transform: m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 4 + m_RootOrder: 3 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!114 &1219551440 MonoBehaviour: @@ -2488,7 +2488,7 @@ Mesh: m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_Name: pb_Mesh24568 + m_Name: pb_Mesh36606 serializedVersion: 10 m_SubMeshes: - serializedVersion: 2 @@ -2713,29 +2713,25 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 6c7eefc8f6b5e68458f28981e3eb5196, type: 3} m_Name: m_EditorClassIdentifier: - enemyPrefab: {fileID: 2422363816341469345, guid: 878f06b5ada303f47b84bdd84f0d4917, type: 3} ---- !u!1001 &1741255951 + enemyPrefab: {fileID: 0} +--- !u!1001 &1876611742 PrefabInstance: m_ObjectHideFlags: 0 serializedVersion: 2 m_Modification: m_TransformParent: {fileID: 0} m_Modifications: - - target: {fileID: -3976935303735240655, guid: 5d4e7d89f2ca88444a90ee28fd289237, type: 3} - propertyPath: m_DefaultControlScheme - value: Gamepad - objectReference: {fileID: 0} - - target: {fileID: -3976935303735240655, guid: 5d4e7d89f2ca88444a90ee28fd289237, type: 3} - propertyPath: m_NeverAutoSwitchControlSchemes - value: 0 - objectReference: {fileID: 0} + - target: {fileID: 260737732976867580, guid: 5d4e7d89f2ca88444a90ee28fd289237, type: 3} + propertyPath: m_Controller + value: + objectReference: {fileID: 9100000, guid: b60dc9aa529b314489f628aa3b57c470, type: 2} - target: {fileID: 6281018500087805442, guid: 5d4e7d89f2ca88444a90ee28fd289237, type: 3} propertyPath: m_Name value: Player objectReference: {fileID: 0} - target: {fileID: 6281018500087805443, guid: 5d4e7d89f2ca88444a90ee28fd289237, type: 3} propertyPath: m_RootOrder - value: 3 + value: 4 objectReference: {fileID: 0} - target: {fileID: 6281018500087805443, guid: 5d4e7d89f2ca88444a90ee28fd289237, type: 3} propertyPath: m_LocalPosition.x @@ -2743,7 +2739,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 6281018500087805443, guid: 5d4e7d89f2ca88444a90ee28fd289237, type: 3} propertyPath: m_LocalPosition.y - value: 2.03 + value: 1.21 objectReference: {fileID: 0} - target: {fileID: 6281018500087805443, guid: 5d4e7d89f2ca88444a90ee28fd289237, type: 3} propertyPath: m_LocalPosition.z diff --git a/Assets/Scripts/PlayerScript.cs b/Assets/Scripts/PlayerScript.cs index 099b3d6..3649c0e 100644 --- a/Assets/Scripts/PlayerScript.cs +++ b/Assets/Scripts/PlayerScript.cs @@ -11,6 +11,8 @@ public class PlayerScript : MonoBehaviour Vector2 processedMoveInput; Vector2 lastMove; + private Animator anima; + float lastMoveTimestamp; int killCount; @@ -44,7 +46,7 @@ void HandleMovement(CharacterController controller) var move = moveInput.y * transform.forward + moveInput.x * transform.right; - controller.SimpleMove(Vector3.ClampMagnitude(move, 1f) * 6f); + controller.SimpleMove(Vector3.ClampMagnitude(move, 1f) * 4f); } public void Fire(InputAction.CallbackContext context) @@ -89,12 +91,14 @@ public void MoveCheck() { currentMoveInput = Vector2.zero; } + anima.SetFloat("speed", controller.velocity.magnitude/1.2f); } void Awake() { controller = GetComponent(); playerInput = GetComponent(); + anima = transform.Find("DogPolyart").GetComponent(); } void OnGUI()