You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I have initialized my fsm with 2 custom types (AIState and AIStateEvent) instead of string type.
fsm = new StateMachine<AIState, AIStateEvent>();
I see that there are various useful shortcuts, but I can't find one to create a transition directly between custom types in AddTriggerTransition. So, I have to use:
fsm.AddTriggerTransition(AIStateEvent.PLAYER_DETECTED, new Transition<AIState>(AIState.IDLE, AIState.CHASE));
Am I correct in assuming there isn’t a shortcut like this?
Of course, I could implement my own shortcut, but I’d prefer to use what the library provides rather than adding extra layers. :)
Something like this should work as extension:
public static void AddTriggerTransition<E, S>(this StateMachine<S, E> stateMachine, E trigger, S from, S to)
{
stateMachine.AddTriggerTransition(trigger, new Transition<S>(from, to));
}
The text was updated successfully, but these errors were encountered:
Hello, I have initialized my fsm with 2 custom types (
AIState
andAIStateEvent
) instead ofstring
type.I see that there are various useful shortcuts, but I can't find one to create a transition directly between custom types in
AddTriggerTransition
. So, I have to use:Am I correct in assuming there isn’t a shortcut like this?
Of course, I could implement my own shortcut, but I’d prefer to use what the library provides rather than adding extra layers. :)
Something like this should work as extension:
The text was updated successfully, but these errors were encountered: