Пример #1
0
        public static List <SkillState> FindStatesUsingEvent(Skill fsm, string eventName)
        {
            List <SkillInfo> list = new List <SkillInfo>();

            list.AddRange(SkillInfo.FindTransitionsUsingEvent(fsm, eventName));
            list.AddRange(SkillInfo.FindActionsUsingEvent(fsm, eventName));
            return(SkillInfo.GetStateList(list));
        }
Пример #2
0
        public static List <SkillInfo> FindTransitionsUsingEvent(List <Skill> fsmSelection, string eventName)
        {
            List <SkillInfo> list = new List <SkillInfo>();

            using (List <Skill> .Enumerator enumerator = fsmSelection.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    Skill current = enumerator.get_Current();
                    list.AddRange(SkillInfo.FindTransitionsUsingEvent(current, eventName));
                }
            }
            return(list);
        }
Пример #3
0
        private void OnClickEventTarget(SkillLogEntry entry)
        {
            switch (entry.get_EventTarget().target)
            {
            case 0:
            case 6:
                break;

            case 1:
                if (entry.get_Event() != null)
                {
                    GenericMenu  genericMenu = new GenericMenu();
                    List <Skill> fsmList     = SkillInfo.GetFsmList(SkillInfo.FindTransitionsUsingEvent(entry.get_Event().get_Name()));
                    using (List <Skill> .Enumerator enumerator = fsmList.GetEnumerator())
                    {
                        while (enumerator.MoveNext())
                        {
                            Skill current = enumerator.get_Current();
                            genericMenu.AddItem(new GUIContent(Labels.GetFullFsmLabel(current)), false, new GenericMenu.MenuFunction2(SkillEditor.SelectFsm), current);
                        }
                    }
                    genericMenu.ShowAsContext();
                    return;
                }
                break;

            case 2:
            {
                GameObject ownerDefaultTarget = SkillEditor.SelectedFsm.GetOwnerDefaultTarget(entry.get_EventTarget().gameObject);
                Skill      fsm = SkillSelection.FindFsmOnGameObject(ownerDefaultTarget, entry.get_EventTarget().fsmName.get_Value());
                if (fsm != null)
                {
                    SkillEditor.SelectFsm(fsm);
                    return;
                }
                break;
            }

            case 3:
                if (entry.get_EventTarget().fsmComponent != null)
                {
                    SkillEditor.SelectFsm(entry.get_EventTarget().fsmComponent.get_Fsm());
                    return;
                }
                break;

            case 4:
                if (entry.get_Event() != null)
                {
                    GenericMenu  genericMenu2 = new GenericMenu();
                    List <Skill> fsmList2     = SkillInfo.GetFsmList(SkillInfo.FindTransitionsUsingEvent(entry.get_Event().get_Name()));
                    using (List <Skill> .Enumerator enumerator2 = fsmList2.GetEnumerator())
                    {
                        while (enumerator2.MoveNext())
                        {
                            Skill current2 = enumerator2.get_Current();
                            genericMenu2.AddItem(new GUIContent(Labels.GetFullFsmLabel(current2)), false, new GenericMenu.MenuFunction2(SkillEditor.SelectFsm), current2);
                        }
                    }
                    genericMenu2.ShowAsContext();
                    return;
                }
                break;

            case 5:
                SkillEditor.SelectFsm(entry.get_State().get_Fsm().get_Host());
                break;

            default:
                return;
            }
        }
Пример #4
0
 public static List <SkillInfo> FindTransitionsUsingEvent(string eventName)
 {
     return(SkillInfo.FindTransitionsUsingEvent(SkillEditor.FsmList, eventName));
 }