Ejemplo n.º 1
0
        public static List <SkillInfo> FindStatesUsingAction(Skill fsm, Type actionType)
        {
            List <SkillInfo> list = new List <SkillInfo>();

            SkillState[] states = fsm.get_States();
            for (int i = 0; i < states.Length; i++)
            {
                SkillState fsmState = states[i];
                if (fsmState.get_ActionsLoaded())
                {
                    int num = 0;
                    SkillStateAction[] actions = fsmState.get_Actions();
                    for (int j = 0; j < actions.Length; j++)
                    {
                        SkillStateAction fsmStateAction = actions[j];
                        if (fsmStateAction.GetType() == actionType)
                        {
                            list.Add(new SkillInfo
                            {
                                fsm         = fsm,
                                state       = fsmState,
                                action      = fsmStateAction,
                                actionIndex = num
                            });
                        }
                        num++;
                    }
                }
            }
            return(list);
        }