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

42 lines
769 B
C#
Raw Normal View History

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