private void ChangeVariableType(SkillVariable fsmVariable, VariableType newType) { if (!this.CheckDeleteVariable(Strings.get_Dialog_Edit_Variable_Type(), Strings.get_Dialog_Edit_Variable_Type_Are_you_sure(), fsmVariable)) { return; } this.RegisterUndo(Strings.get_Label_Edit_Variable()); string name = fsmVariable.Name; string tooltip = fsmVariable.Tooltip; string category = fsmVariable.Category; bool showInInspector = fsmVariable.ShowInInspector; if (this.fsmOwner != null) { SkillBuilder.RemoveVariableUsage(fsmVariable.NamedVar); } else { SkillSearch.UpdateAll(); SkillBuilder.RemoveGlobalVariableUsage(fsmVariable.NamedVar); } SkillVariable.DeleteVariable(this.target, fsmVariable); SkillVariable fsmVariable2 = this.AddVariable(newType, name, false); fsmVariable2.Tooltip = tooltip; fsmVariable2.SetCategory(category); fsmVariable2.ShowInInspector = showInInspector; this.BuildFsmVariableList(true); this.SelectVariable(name); }
public override void DoGUI() { this.fsmVariablesEditor.SetTarget(SkillVariables.get_GlobalsComponent()); this.fsmVariablesEditor.OnGUI(); if (GUILayout.Button(new GUIContent(Strings.get_GlobalVariablesWindow_Refresh_Used_Count_In_This_Scene(), Strings.get_GlobalVariablesWindow_Refresh_Tooltip()), new GUILayoutOption[0])) { SkillSearch.UpdateAll(); } EditorGUILayout.HelpBox(Strings.get_GlobalVariablesWindow_Note_Asset_Location(), 1); }