public static void InsertAction(this PlayMakerFSM fsm, string stateName, FsmStateAction action, int index) { FsmState t = fsm.GetState(stateName); List <FsmStateAction> actions = t.Actions.ToList(); actions.Insert(index, action); t.Actions = actions.ToArray(); action.Init(t); }
public static void InsertAction(PlayMakerFSM fsm, string stateName, FsmStateAction action, int index) { foreach (FsmState t in fsm.FsmStates) { if (t.Name != stateName) { continue; } List <FsmStateAction> actions = t.Actions.ToList(); actions.Insert(index, action); t.Actions = actions.ToArray(); action.Init(t); } }
public static void InsertAction(this FsmState state, int index, FsmStateAction action) { state.Actions = state.Actions.Insert(index, action).ToArray(); action.Init(state); }