player 1 animations

This commit is contained in:
kimrdd 2024-02-03 13:07:46 +01:00
parent 1227fbbda7
commit 258888766f
5 changed files with 42 additions and 38 deletions

View File

@ -62,7 +62,7 @@ AnimatorStateMachine:
m_ChildStates: m_ChildStates:
- serializedVersion: 1 - serializedVersion: 1
m_State: {fileID: 9123080415032741332} m_State: {fileID: 9123080415032741332}
m_Position: {x: 40, y: 70, z: 0} m_Position: {x: 30, y: 40, z: 0}
- serializedVersion: 1 - serializedVersion: 1
m_State: {fileID: 548892628922324246} m_State: {fileID: 548892628922324246}
m_Position: {x: 570, y: 80, z: 0} m_Position: {x: 570, y: 80, z: 0}
@ -85,7 +85,7 @@ AnimatorStateMachine:
m_EntryTransitions: [] m_EntryTransitions: []
m_StateMachineTransitions: {} m_StateMachineTransitions: {}
m_StateMachineBehaviours: [] 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_EntryPosition: {x: 20, y: 160, z: 0}
m_ExitPosition: {x: 800, y: 120, z: 0} m_ExitPosition: {x: 800, y: 120, z: 0}
m_ParentStateMachinePosition: {x: 800, y: 20, z: 0} m_ParentStateMachinePosition: {x: 800, y: 20, z: 0}
@ -150,31 +150,31 @@ AnimatorController:
serializedVersion: 5 serializedVersion: 5
m_AnimatorParameters: m_AnimatorParameters:
- m_Name: Idle - m_Name: Idle
m_Type: 4 m_Type: 9
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_DefaultFloat: 0 m_DefaultFloat: 0
m_DefaultInt: 0 m_DefaultInt: 0
m_DefaultBool: 0 m_DefaultBool: 0
m_Controller: {fileID: 0} m_Controller: {fileID: 0}
- m_Name: Run - 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_DefaultFloat: 0
m_DefaultInt: 0 m_DefaultInt: 0
m_DefaultBool: 0 m_DefaultBool: 0
m_Controller: {fileID: 0} m_Controller: {fileID: 0}
- m_Name: Swing - m_Name: Swing
m_Type: 4 m_Type: 9
m_DefaultFloat: 0 m_DefaultFloat: 0
m_DefaultInt: 0 m_DefaultInt: 0
m_DefaultBool: 0 m_DefaultBool: 0

View File

@ -186,8 +186,9 @@ GameObject:
- component: {fileID: 3086165646112058191} - component: {fileID: 3086165646112058191}
- component: {fileID: 1508323898269695585} - component: {fileID: 1508323898269695585}
- component: {fileID: 5467488512035376674} - component: {fileID: 5467488512035376674}
- component: {fileID: 3878447480781341932}
m_Layer: 7 m_Layer: 7
m_Name: Player m_Name: Player1
m_TagString: Player m_TagString: Player
m_Icon: {fileID: 0} m_Icon: {fileID: 0}
m_NavMeshLayer: 0 m_NavMeshLayer: 0
@ -289,3 +290,15 @@ MonoBehaviour:
anchor: {fileID: 1170758327458850867} anchor: {fileID: 1170758327458850867}
body: {fileID: 1508323898269695585} body: {fileID: 1508323898269695585}
locked: 0 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:

View File

@ -1924,7 +1924,7 @@ PrefabInstance:
m_Modifications: m_Modifications:
- target: {fileID: 320690117028550720, guid: 99a6ff8b9591949439b620b13bd249a4, type: 3} - target: {fileID: 320690117028550720, guid: 99a6ff8b9591949439b620b13bd249a4, type: 3}
propertyPath: m_LocalPosition.x propertyPath: m_LocalPosition.x
value: 0 value: -16.65
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 320690117028550720, guid: 99a6ff8b9591949439b620b13bd249a4, type: 3} - target: {fileID: 320690117028550720, guid: 99a6ff8b9591949439b620b13bd249a4, type: 3}
propertyPath: m_LocalPosition.y propertyPath: m_LocalPosition.y

View File

@ -10,33 +10,24 @@ public class PlayerAnimationHandler : MonoBehaviour
animator = GetComponentInChildren<Animator>(); animator = GetComponentInChildren<Animator>();
} }
void Update() public void Idle()
{ {
if (Input.GetKeyDown(KeyCode.I)) animator.SetTrigger("Idle");
Idle(true);
if (Input.GetKeyDown(KeyCode.Space))
Mop(true);
if (Input.GetKeyDown(KeyCode.R))
Run(true);
} }
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); animator.SetTrigger("RunMop");
}
public void RunMop(bool active)
{
animator.SetBool("RunMop", active);
} }
} }