大修改调整
This commit is contained in:
41
Assets/Scripts/Fishing/Player/States/PlayerStateIdle.cs
Normal file
41
Assets/Scripts/Fishing/Player/States/PlayerStateIdle.cs
Normal file
@@ -0,0 +1,41 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user