SHADE_Y3/Assets/Scripts/Gameplay/Player/PlayerStates/UT_PlayerIdleState.cs

57 lines
1.7 KiB
C#
Raw Normal View History

using SHADE;
using System;
public class PlayerIdleState : BaseState
{
2023-03-10 16:26:52 +08:00
private bool holdItem;
public PlayerIdleState(StateMachine stateMachine, bool hi) : base(stateMachine)
{
stateName = "Idle State";
2023-03-10 16:26:52 +08:00
holdItem = hi;
}
public override void OnEnter()
{
//Debug.Log("WALK ENTER");
2023-03-10 16:26:52 +08:00
if (PlayerAnimations.Instance)
{
if (!holdItem)
{
2023-03-10 19:40:48 +08:00
if (PlayerAnimations.Instance.playerIdleClip)
{
PlayerAnimations.Instance.playerAnimator.Play(PlayerAnimations.Instance.playerIdleClip);
PlayerAnimations.Instance.BagAnimator.Play(PlayerAnimations.Instance.playerIdleClip);
PlayerAnimations.Instance.silhoPlayerAnimator.Play(PlayerAnimations.Instance.playerIdleClip);
PlayerAnimations.Instance.silhoBagAnimator.Play(PlayerAnimations.Instance.playerIdleClip);
}
2023-03-10 16:26:52 +08:00
}
else
{
2023-03-10 19:40:48 +08:00
if (PlayerAnimations.Instance.playerCarryIdleClip)
{
PlayerAnimations.Instance.playerAnimator.Play(PlayerAnimations.Instance.playerCarryIdleClip);
PlayerAnimations.Instance.BagAnimator.Play(PlayerAnimations.Instance.playerCarryIdleClip);
PlayerAnimations.Instance.silhoPlayerAnimator.Play(PlayerAnimations.Instance.playerCarryIdleClip);
PlayerAnimations.Instance.silhoBagAnimator.Play(PlayerAnimations.Instance.playerCarryIdleClip);
}
2023-03-10 16:26:52 +08:00
}
}
}
public override void update()
{
//Debug.Log("WALKING");
}
public override void fixedUpdate()
{
//Debug.Log("FIXED WALKING");
}
public override void OnExit()
{
//Debug.Log("WALK EXIT");
}
public override void onTriggerEnter(CollisionInfo info)
{
//Debug.Log("TRIGGER");
}
}