SHADE_Y3/Assets/Scripts/Gameplay/Player/UT_PlayerWalkState.cs

42 lines
794 B
C#
Raw Permalink Normal View History

using SHADE;
using System;
public class PlayerWalkState : BaseState
{
2022-11-21 21:01:44 +08:00
private float timer;
private float delay = 0.5f;
public PlayerWalkState(StateMachine stateMachine) : base(stateMachine)
{
stateName = "Walk State";
}
public override void OnEnter()
{
//Debug.Log("WALK ENTER");
2022-11-21 21:01:44 +08:00
timer = delay;
}
public override void update()
{
//Debug.Log("WALKING");
2022-11-21 21:01:44 +08:00
timer += Time.DeltaTimeF;
if (timer > delay)
{
Audio.PlayBGMOnce2D("event:/Raccoon/raccoon_footsteps");
timer = 0;
}
}
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");
}
}