public override void Destroy() { Dictionary <string, StateInfo> FinalMachine = GenerateMachine(); foreach (KeyValuePair <string, StateInfo> pair in FinalMachine) { RetroFSM.Chapter(ChapterHash).RemoveState(pair.Value); } }
private string _FSMID = "FSMOverride"; // "FSMOverride" can be set to any ID we want void Start() { // We can start an FSM through the FSMBehavior by giving it a list of the FSMConstructors we created. // This will start the FSM when the game starts(useful for gameplay states e.g. splashscreen, main menu, gameplay, pause, etc) // OR we can manually start a new FSM through this function. This is helpful for when you want a bunch of gameobjects to share an FSM(e.g AI) RetroFSM.StartNewChapter <ExampleFSMOverrideConstructor>(_FSMID); // this is how we can get a handle to an FSM so we can change states _FSMOverride = RetroFSM.Chapter(_FSMID); }
public override void Build() { Dictionary <string, StateInfo> FinalMachine = GenerateMachine(); foreach (KeyValuePair <string, StateInfo> pair in FinalMachine) { RetroFSM.Chapter(ChapterHash).AddState(pair.Value); // check for default if (pair.Value.Attribute.IsDefault) { RetroFSM.Chapter(ChapterHash).SetDefaultState(pair.Value); } } }