This commit is contained in:
CortexCore
2023-09-01 14:35:05 +08:00
parent a71288cf2d
commit 5561f5c3cc
136 changed files with 69284 additions and 66121 deletions

View File

@@ -10,14 +10,7 @@ using UnityEngine.UIElements;
namespace BITKit.StateMachine
{
[Serializable]
public abstract class MonoStateMachine
{
#if UNITY_EDITOR
public abstract IState CurrentStateAsIState { get; }
#endif
}
[Serializable]
public class MonoStateMachine<TState> :MonoStateMachine , IStateMachine<TState>, IMonoProxy where TState : IState
public class MonoStateMachine<TState> : IStateMachine<TState>, IMonoProxy where TState : IState
{
public bool Enabled
{
@@ -57,10 +50,10 @@ namespace BITKit.StateMachine
TransitionState(states[0]);
}
}
public void UpdateState()
public void UpdateState(float deltaTime)
{
if (Enabled)
CurrentState?.OnStateUpdate();
CurrentState?.OnStateUpdate(deltaTime);
}
public void DisposeState()
@@ -86,7 +79,6 @@ namespace BITKit.StateMachine
_currentStateName = newState.GetType().Name;
newState.Enabled = true;
}
public override IState CurrentStateAsIState => CurrentState;
}
}