示例#1
0
        public Skill GetFsmSelection(GameObject go)
        {
            if (go == null)
            {
                return(null);
            }
            using (List <SkillSelectionHistory.HistoryItem> .Enumerator enumerator = this.recentlySelectedList.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    SkillSelectionHistory.HistoryItem current = enumerator.get_Current();
                    if (current.fsm != null && current.fsm.get_GameObject() == go)
                    {
                        Skill fsm = current.fsm;
                        return(fsm);
                    }
                }
            }
            PlayMakerFSM playMakerFSM = SkillSelection.FindFsmComponentOnGameObject(go);

            if (!(playMakerFSM != null))
            {
                return(null);
            }
            return(playMakerFSM.get_Fsm());
        }
示例#2
0
 public void SanityCheck()
 {
     using (List <SkillSelection> .Enumerator enumerator = this.selectionCache.GetEnumerator())
     {
         while (enumerator.MoveNext())
         {
             SkillSelection current = enumerator.get_Current();
             current.SanityCheck();
         }
     }
     this.selectionCache.RemoveAll((SkillSelection r) => r.IsOrphaned);
     this.backList.RemoveAll((SkillSelectionHistory.HistoryItem r) => r.fsm == null);
     this.forwardList.RemoveAll((SkillSelectionHistory.HistoryItem r) => r.fsm == null);
     this.recentlySelectedList.RemoveAll((SkillSelectionHistory.HistoryItem r) => r.fsm == null);
 }
示例#3
0
        private SkillSelection GetSelection(Skill fsm)
        {
            if (fsm == null)
            {
                return(SkillSelection.None);
            }
            using (List <SkillSelection> .Enumerator enumerator = this.selectionCache.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    SkillSelection current = enumerator.get_Current();
                    if (current.IsFor(fsm))
                    {
                        return(current);
                    }
                }
            }
            SkillSelection fsmSelection = new SkillSelection(fsm);

            this.selectionCache.Add(fsmSelection);
            return(fsmSelection);
        }
示例#4
0
 public void DebugGUI()
 {
     GUILayout.Label("Back List: ", EditorStyles.get_boldLabel(), new GUILayoutOption[0]);
     using (List <SkillSelectionHistory.HistoryItem> .Enumerator enumerator = this.backList.GetEnumerator())
     {
         while (enumerator.MoveNext())
         {
             SkillSelectionHistory.HistoryItem current = enumerator.get_Current();
             GUILayout.Label(Labels.GetFullFsmLabelWithInstanceID(current.fsm), new GUILayoutOption[0]);
         }
     }
     GUILayout.Label("Forward List: ", EditorStyles.get_boldLabel(), new GUILayoutOption[0]);
     using (List <SkillSelectionHistory.HistoryItem> .Enumerator enumerator2 = this.forwardList.GetEnumerator())
     {
         while (enumerator2.MoveNext())
         {
             SkillSelectionHistory.HistoryItem current2 = enumerator2.get_Current();
             GUILayout.Label(Labels.GetFullFsmLabelWithInstanceID(current2.fsm), new GUILayoutOption[0]);
         }
     }
     GUILayout.Label("RecentlySelectedList: ", EditorStyles.get_boldLabel(), new GUILayoutOption[0]);
     using (List <SkillSelectionHistory.HistoryItem> .Enumerator enumerator3 = this.recentlySelectedList.GetEnumerator())
     {
         while (enumerator3.MoveNext())
         {
             SkillSelectionHistory.HistoryItem current3 = enumerator3.get_Current();
             GUILayout.Label(Labels.GetFullFsmLabelWithInstanceID(current3.fsm), new GUILayoutOption[0]);
         }
     }
     GUILayout.Label("SelectionCache: ", EditorStyles.get_boldLabel(), new GUILayoutOption[0]);
     using (List <SkillSelection> .Enumerator enumerator4 = this.selectionCache.GetEnumerator())
     {
         while (enumerator4.MoveNext())
         {
             SkillSelection current4 = enumerator4.get_Current();
             GUILayout.Label(Labels.GetFullFsmLabelWithInstanceID(current4.ActiveFsm), new GUILayoutOption[0]);
         }
     }
 }
示例#5
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;
            }
        }
示例#6
0
 public static bool GameObjectHasFSM(GameObject go)
 {
     return(SkillSelection.GameObjectHasFSM(go));
 }
示例#7
0
 public static Skill FindFsmOnGameObject(GameObject go, string name)
 {
     return(SkillSelection.FindFsmOnGameObject(go, name));
 }
示例#8
0
 public static PlayMakerFSM FindFsmComponentOnGameObject(GameObject go)
 {
     return(SkillSelection.FindFsmComponentOnGameObject(go));
 }
示例#9
0
 public static Skill FindFsmOnGameObject(GameObject go)
 {
     return(SkillSelection.FindFsmOnGameObject(go));
 }