private void Callback(string name)
 {
     name = VariableEditor.ProcessName(name);
     if (this.callback != null)
     {
         this.callback(name);
     }
 }
        private void CreateVariable(string variableName)
        {
            variableName = VariableEditor.ProcessName(variableName);

            EditorGUI.FocusTextInControl(null);
            GUIUtility.keyboardControl = 0;

            TTarget instance = this.CreateReferenceInstance(variableName);

            this.spReferences.AddToObjectArray <TTarget>(instance);
            this.AddSubEditorElement(instance, -1, true);
        }
Exemple #3
0
 private void PaintLocalVariable(SerializedProperty spName, Rect rect, GUIContent label)
 {
     if (this.spTargetType.intValue == (int)HelperLocalVariable.Target.GameObject)
     {
         EditorGUI.BeginDisabledGroup(this.spTargetObject.objectReferenceValue == null);
         this.PaintVariables(rect, spName, label);
         EditorGUI.EndDisabledGroup();
     }
     else
     {
         string previousName = spName.stringValue;
         EditorGUI.PropertyField(rect, spName, label);
         if (previousName != spName.stringValue)
         {
             spName.stringValue = VariableEditor.ProcessName(spName.stringValue);
         }
     }
 }