Files
Fishing2/Assets/Scripts/Fishing/Player/States/PlayerStateIdle.cs
2026-01-11 23:58:02 +08:00

41 lines
906 B
C#

namespace NBF
{
/// <summary>
/// 闲置中
/// </summary>
public class PlayerStateIdle : PlayerStateBase
{
public override uint StateId => (uint)PlayerState.Idle;
private bool _nextState = false;
protected override void onEnter()
{
_nextState = false;
InputManager.OnOp1Action += OnOp1Action;
}
private void OnOp1Action(bool performed)
{
if (!Player.Rod) return;
if (performed)
{
_nextState = true;
}
}
protected override void onExit()
{
InputManager.OnOp1Action -= OnOp1Action;
}
protected override uint onUpdate()
{
if (_nextState)
{
return (uint)PlayerState.Prepare;
}
return States.None;
}
}
}