57 lines
1.7 KiB
C#
57 lines
1.7 KiB
C#
using SHADE;
|
|
using System;
|
|
|
|
public class PlayerIdleState : BaseState
|
|
{
|
|
private bool holdItem;
|
|
public PlayerIdleState(StateMachine stateMachine, bool hi) : base(stateMachine)
|
|
{
|
|
stateName = "Idle State";
|
|
holdItem = hi;
|
|
}
|
|
public override void OnEnter()
|
|
{
|
|
//Debug.Log("WALK ENTER");
|
|
if (PlayerAnimations.Instance)
|
|
{
|
|
if (!holdItem)
|
|
{
|
|
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);
|
|
}
|
|
}
|
|
else
|
|
{
|
|
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);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
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");
|
|
}
|
|
}
|
|
|