This commit is contained in:
CortexCore
2024-04-16 04:15:06 +08:00
parent b673a9438d
commit 0362b2c606
183 changed files with 5695 additions and 1453 deletions

View File

@@ -51,10 +51,10 @@ namespace BITKit.StateMachine
state.Initialize();
StateDictionary.Add(state.GetType(), state);
}
if (states.Count > 0)
{
TransitionState(states[0]);
}
// if (states.Count > 0)
// {
// TransitionState(states[0]);
// }
}
public void UpdateState(float deltaTime)
{
@@ -104,9 +104,8 @@ namespace BITKit.StateMachine
{
BIT4Log.Log<MonoStateMachine<TState>>($"TransitionState from {_currentStateName} to {newState.GetType().Name}");
}
newState.OnStateEntry(oldState);
CurrentState = newState;
newState.OnStateEntry(oldState);
OnStateChanged?.Invoke(oldState, newState);
_currentStateName = newState.GetType().Name;
newState.Enabled = true;