I realize this may be super simple, but I’m actually working inside of a Custom List, so I have a Keycode, a Button and two string fields inside of my List, what I want to do is when I finish typing in my last string field, I want to run a script. Any ideas? Thank you! (:
Here is how my code is setup currently - What I need help with is how to get my current focus in the -Editor- then get the string value from this.
using UnityEngine;
using System.Collections;
using UnityEditor;
using System.Collections.Generic;
using UnityEngine.UI;
[CustomEditor(typeof(InputManager))]
public class InputManagerEditor : Editor {
public override void OnInspectorGUI()
{
serializedObject.Update ();
InputManager myTarget = (InputManager)target;
EditorGUILayout.PropertyField(serializedObject.FindProperty("inputManagerList"), true);
if(!GUI.GetNameOfFocusedControl().Equals("") && Event.current.keyCode == KeyCode.Return)
TagEditor.AddToTagMenu(GUI.GetNameOfFocusedControl().ToString());
serializedObject.ApplyModifiedProperties();
}
}