コード例 #1
0
        public void Clear()
        {
            List <NamedVariable> list = new List <NamedVariable>(SkillSearch.globalVariablesUsage.get_Keys());

            using (List <NamedVariable> .Enumerator enumerator = list.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    NamedVariable    current = enumerator.get_Current();
                    List <SkillInfo> globalVariablesUsageList = SkillSearch.GetGlobalVariablesUsageList(current);
                    List <SkillInfo> list2 = new List <SkillInfo>(globalVariablesUsageList);
                    using (List <SkillInfo> .Enumerator enumerator2 = globalVariablesUsageList.GetEnumerator())
                    {
                        while (enumerator2.MoveNext())
                        {
                            SkillInfo current2 = enumerator2.get_Current();
                            if (current2.fsm == this.fsm)
                            {
                                list2.Remove(current2);
                            }
                        }
                    }
                    SkillSearch.globalVariablesUsage.set_Item(current, list2);
                }
            }
            this.eventUsage.Clear();
            this.variableUsage.Clear();
            this.globalVariablesUsed.Clear();
            this.actionUsage.Clear();
        }
コード例 #2
0
 private void AddVariableUsage(NamedVariable variable)
 {
     if (variable == null)
     {
         return;
     }
     if (this.IsGlobalVariable(variable))
     {
         SkillSearch.GetGlobalVariablesUsageList(variable).Add(new SkillInfo(SkillSearch.currentInfo));
         if (!this.globalVariablesUsed.Contains(variable))
         {
             this.globalVariablesUsed.Add(variable);
             return;
         }
     }
     else
     {
         this.GetVariableUsageList(variable).Add(new SkillInfo(SkillSearch.currentInfo));
     }
 }
コード例 #3
0
        private static void DoVariableContextMenu(SkillVariable variable)
        {
            GenericMenu      genericMenu = new GenericMenu();
            List <SkillInfo> globalVariablesUsageList = SkillSearch.GetGlobalVariablesUsageList(variable.NamedVar);

            if (globalVariablesUsageList.get_Count() == 0)
            {
                genericMenu.AddDisabledItem(new GUIContent(Strings.get_Menu_No_FSMs_use_this_variable()));
            }
            else
            {
                using (List <SkillInfo> .Enumerator enumerator = globalVariablesUsageList.GetEnumerator())
                {
                    while (enumerator.MoveNext())
                    {
                        SkillInfo current = enumerator.get_Current();
                        genericMenu.AddItem(new GUIContent(Labels.GetFullFsmLabel(current.fsm)), SkillEditor.SelectedFsm == current.fsm, new GenericMenu.MenuFunction2(EditorCommands.SelectFsm), current.fsm);
                    }
                }
            }
            genericMenu.ShowAsContext();
        }
コード例 #4
0
        private static void DoGlobalVariableContextMenu(NamedVariable variable)
        {
            GenericMenu      genericMenu = new GenericMenu();
            List <SkillInfo> globalVariablesUsageList = SkillSearch.GetGlobalVariablesUsageList(variable);

            if (globalVariablesUsageList.get_Count() == 0)
            {
                genericMenu.AddDisabledItem(new GUIContent(Strings.get_Menu_No_FSMs_use_this_variable()));
            }
            else
            {
                using (List <SkillInfo> .Enumerator enumerator = globalVariablesUsageList.GetEnumerator())
                {
                    while (enumerator.MoveNext())
                    {
                        SkillInfo current = enumerator.get_Current();
                        if (current.fsm == SkillEditor.SelectedFsm)
                        {
                            genericMenu.AddItem(new GUIContent(current.state.get_Name()), SkillEditor.SelectedState == current.state, new GenericMenu.MenuFunction2(FsmVariablesEditor.SelectState), current.state);
                        }
                    }
                }
                using (List <SkillInfo> .Enumerator enumerator2 = globalVariablesUsageList.GetEnumerator())
                {
                    while (enumerator2.MoveNext())
                    {
                        SkillInfo current2 = enumerator2.get_Current();
                        if (current2.fsm != SkillEditor.SelectedFsm)
                        {
                            genericMenu.AddItem(new GUIContent(Labels.GetFullFsmLabel(current2.fsm)), SkillEditor.SelectedFsm == current2.fsm, new GenericMenu.MenuFunction2(EditorCommands.SelectFsm), current2.fsm);
                        }
                    }
                }
            }
            genericMenu.AddSeparator("");
            genericMenu.AddItem(new GUIContent(Strings.get_Menu_Make_Local_Variable()), false, new GenericMenu.MenuFunction2(FsmVariablesEditor.MoveToLocal), variable);
            genericMenu.ShowAsContext();
        }