protected override void RenameEnded(RenameEndedArgs args) { if (args.acceptedRename) { var element = treeModel.Find(args.itemID); VariablesUtilityEditor.RenameAsset(element.variable, args.newName); treeModel.SetData(VariablesTableGenerator.GenerateTree()); Reload(); } }
void DoBody(Rect rectLeft, Rect rectRight) { EditorGUI.BeginChangeCheck(); _textLeft = EditorGUI.TextArea(rectLeft, _textLeft); if (EditorGUI.EndChangeCheck()) { _textRight = VariablesUtilityEditor.ProcessVariableFactoryInputVariables(_textLeft); } GUI.enabled = false; EditorGUI.TextArea(rectRight, _textRight); GUI.enabled = true; }
void DoToolbar(Rect rect) { GUILayout.BeginArea(rect, EditorStyles.toolbar); { GUILayout.BeginHorizontal(); { if (GUILayout.Button("Clear", EditorStyles.toolbarButton)) { _textLeft = _textRight = string.Empty; } GUILayout.FlexibleSpace(); GUI.enabled = _textRight.Trim() != string.Empty; if (GUILayout.Button("Create", EditorStyles.toolbarButton)) { VariablesUtilityEditor.CreateNewVariables(_textRight); } GUI.enabled = true; } GUILayout.EndHorizontal(); } GUILayout.EndArea(); }