2022-11-20 16:27:39 +08:00
|
|
|
|
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)
|
2022-11-20 16:27:39 +08:00
|
|
|
|
{
|
|
|
|
|
stateName = "Idle State";
|
2023-03-10 16:26:52 +08:00
|
|
|
|
holdItem = hi;
|
2022-11-20 16:27:39 +08:00
|
|
|
|
}
|
|
|
|
|
public override void OnEnter()
|
|
|
|
|
{
|
|
|
|
|
//Debug.Log("WALK ENTER");
|
2023-03-10 16:26:52 +08:00
|
|
|
|
if (PlayerAnimations.Instance)
|
|
|
|
|
{
|
|
|
|
|
if (!holdItem)
|
|
|
|
|
{
|
|
|
|
|
PlayerAnimations.Instance.playerAnimator.Play(PlayerAnimations.Instance.playerIdleClip);
|
|
|
|
|
PlayerAnimations.Instance.BagAnimator.Play(PlayerAnimations.Instance.playerIdleClip);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
PlayerAnimations.Instance.playerAnimator.Play(PlayerAnimations.Instance.playerCarryIdleClip);
|
|
|
|
|
PlayerAnimations.Instance.BagAnimator.Play(PlayerAnimations.Instance.playerCarryIdleClip);
|
|
|
|
|
}
|
|
|
|
|
}
|
2022-11-20 16:27:39 +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");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|