예제 #1
0
        public static void SanityCheckEventList(Skill fsm)
        {
            bool flag = false;
            List <SkillEvent> list = new List <SkillEvent>();

            SkillEvent[] events = fsm.get_Events();
            for (int i = 0; i < events.Length; i++)
            {
                SkillEvent fsmEvent = events[i];
                if (!SkillEvent.EventListContainsEvent(list, fsmEvent.get_Name()))
                {
                    list.Add(fsmEvent);
                }
                else
                {
                    flag = true;
                    Debug.LogError(string.Format(Strings.get_Error_Duplicate_Event_Found__(), fsmEvent.get_Name()));
                }
            }
            if (flag)
            {
                fsm.set_Events(list.ToArray());
                SkillEditor.SetFsmDirty(fsm, false, false, true);
            }
        }