1
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user