private void RemoveUnusedCategories(SkillVariables variables, List <SkillVariable> fsmVariables) { List <string> usedVariableCategories = FsmVariablesEditor.GetUsedVariableCategories(fsmVariables); usedVariableCategories.Add(""); List <string> list = new List <string>(variables.get_Categories()); list.Sort(); variables.set_Categories(Enumerable.ToArray <string>(Enumerable.Where <string>(list, new Func <string, bool>(usedVariableCategories.Contains)))); SkillVariable.RemapVariableCategories(variables, fsmVariables); }
public void Reset() { Object selectedFsmOwner = SkillEditor.SelectedFsmOwner; this._fsmVariablesEditor = new FsmVariablesEditor(SkillEditor.Window, selectedFsmOwner); FsmVariablesEditor expr_1D = this._fsmVariablesEditor; expr_1D.SettingsButtonClicked = (EditorApplication.CallbackFunction)Delegate.Combine(expr_1D.SettingsButtonClicked, new EditorApplication.CallbackFunction(this.DoSettingsMenu)); FsmVariablesEditor expr_44 = this._fsmVariablesEditor; expr_44.VariableContextClicked = (FsmVariablesEditor.ContextClickVariable)Delegate.Combine(expr_44.VariableContextClicked, new FsmVariablesEditor.ContextClickVariable(this.DoVariableContextMenu)); this._fsmVariablesEditor.Reset(); }
public override void Initialize() { this.isToolWindow = true; GlobalVariablesWindow.instance = this; this.InitWindowTitle(); base.set_minSize(new Vector2(200f, 200f)); this.fsmVariablesEditor = new FsmVariablesEditor(this, SkillVariables.get_GlobalsComponent()); FsmVariablesEditor expr_3F = this.fsmVariablesEditor; expr_3F.SettingsButtonClicked = (EditorApplication.CallbackFunction)Delegate.Combine(expr_3F.SettingsButtonClicked, new EditorApplication.CallbackFunction(this.DoSettingsMenu)); FsmVariablesEditor expr_66 = this.fsmVariablesEditor; expr_66.VariableContextClicked = (FsmVariablesEditor.ContextClickVariable)Delegate.Combine(expr_66.VariableContextClicked, new FsmVariablesEditor.ContextClickVariable(GlobalVariablesWindow.DoVariableContextMenu)); }
private void DoGlobalVariablesTable() { if (SkillSearch.GetGlobalVariablesUsedCount(SkillEditor.SelectedFsm) == 0) { return; } GUILayout.Space(10f); SkillEditorGUILayout.LightDivider(new GUILayoutOption[0]); GUILayout.BeginHorizontal(SkillEditorStyles.TableRowBox, new GUILayoutOption[0]); GUILayout.Label(SkillEditorContent.GlobalsLabel, new GUILayoutOption[0]); GUILayout.FlexibleSpace(); GUILayout.Label(SkillEditorContent.VariableUseCountLabel, new GUILayoutOption[0]); GUILayout.EndHorizontal(); List <NamedVariable> globalVariablesUsed = SkillSearch.GetGlobalVariablesUsed(SkillEditor.SelectedFsm); using (List <NamedVariable> .Enumerator enumerator = globalVariablesUsed.GetEnumerator()) { while (enumerator.MoveNext()) { NamedVariable current = enumerator.get_Current(); GUILayout.BeginHorizontal(SkillEditorStyles.TableRowBox, new GUILayoutOption[0]); GUIStyle tableRowText = SkillEditorStyles.TableRowText; if (GUILayout.Button(new GUIContent(current.get_Name(), current.get_Tooltip()), tableRowText, new GUILayoutOption[] { GUILayout.MinWidth(155f) })) { Keyboard.ResetFocus(); this.Deselect(); if (Event.get_current().get_button() == 1 || EditorGUI.get_actionKey()) { FsmVariablesEditor.DoGlobalVariableContextMenu(current); } } int globalVariablesUsageCount = SkillSearch.GetGlobalVariablesUsageCount(current); GUILayout.FlexibleSpace(); GUILayout.Label(globalVariablesUsageCount.ToString(CultureInfo.get_CurrentCulture()), tableRowText, new GUILayoutOption[0]); GUILayout.Space(10f); GUILayout.EndHorizontal(); if (FsmEditorSettings.DebugVariables) { SkillEditorGUILayout.ReadonlyTextField(current.ToString(), new GUILayoutOption[0]); } } } }