首次提交
This commit is contained in:
44
Assets/Scripts/Fishing/Player/States/PlayerStateIdle.cs
Normal file
44
Assets/Scripts/Fishing/Player/States/PlayerStateIdle.cs
Normal file
@@ -0,0 +1,44 @@
|
||||
using NBC;
|
||||
|
||||
namespace NBF
|
||||
{
|
||||
/// <summary>
|
||||
/// 闲置中
|
||||
/// </summary>
|
||||
public class PlayerStateIdle : PlayerStateBase
|
||||
{
|
||||
public override uint StateId => (uint)PlayerState.Idle;
|
||||
private bool _nextState = false;
|
||||
|
||||
protected override void onEnter()
|
||||
{
|
||||
Log.Info("enter PlayerStateIdle");
|
||||
_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