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();
     }
 }
예제 #2
0
        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;
        }
예제 #3
0
        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();
        }