private void EditMenu() { obj = (SO_Test)EditorGUILayout.ObjectField("Object", obj, typeof(SO_Test)); if (obj != null) { DrawProperties(new SerializedObject(obj).FindProperty("ids"), true); } }
public static bool OpenAsset(int instanceID, int line) { //try casting to correct type SO_Test obj = EditorUtility.InstanceIDToObject(instanceID) as SO_Test; if (obj != null) { GameDataObjectEditorWindow.OpenWindow(obj); //Notify Unity that we are handling the opening of this asset by returning true return(true); } //if we return false from this callback, Unity will handle opening the asset another way return(false); }
//needed to open the window public static void OpenWindow(SO_Test o) { GameDataObjectEditorWindow window = GetWindow <GameDataObjectEditorWindow>("Game Data Editor"); window.serializedObject = new SerializedObject(o); }