This commit is contained in:
Bob.Song
2026-04-29 17:50:16 +08:00
parent 70769f7e39
commit 8dfd7a44fb
4 changed files with 2 additions and 48 deletions

View File

@@ -37,6 +37,8 @@ namespace NBF
{
playerStageView.Init(this);
}
ChangeState(PlayerState.Idle);
}
public void UpdateState()

View File

@@ -1,32 +0,0 @@
using System;
using System.Collections.Generic;
namespace NBF
{
public class PlayerFSM : PlayerMonoBehaviour
{
private readonly Dictionary<PlayerState, PlayerStageViewBase> _stageViews =
new Dictionary<PlayerState, PlayerStageViewBase>();
private PlayerState _currentState;
private PlayerStageViewBase _currentStateView;
protected override void OnAwake()
{
_stageViews.Add(PlayerState.Idle, new PlayerStageViewIdle());
_stageViews.Add(PlayerState.Prepare, new PlayerStageViewPrepare());
_stageViews.Add(PlayerState.Throw, new PlayerStageViewThrow());
_stageViews.Add(PlayerState.Fishing, new PlayerStageViewFishing());
_stageViews.Add(PlayerState.Fight, new PlayerStageViewFight());
foreach (var playerStageView in _stageViews.Values)
{
playerStageView.Init(Player);
}
}
private void Update()
{
_currentStateView?.Update();
}
}
}

View File

@@ -1,3 +0,0 @@
fileFormatVersion: 2
guid: df8de819db7747ddad97ff39505814a4
timeCreated: 1777454838