public override void OnInspectorGUI() { //base.OnInspectorGUI(); if (GUILayout.Button("Open Editor")) { GameDataObjectEditorWindow.OpenWindow((SO_Test)target); } }
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); }