예제 #1
0
 private void EditMenu()
 {
     obj = (SO_Test)EditorGUILayout.ObjectField("Object", obj, typeof(SO_Test));
     if (obj != null)
     {
         DrawProperties(new SerializedObject(obj).FindProperty("ids"), true);
     }
 }
예제 #2
0
    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);
    }
예제 #3
0
    //needed to open the window
    public static void OpenWindow(SO_Test o)
    {
        GameDataObjectEditorWindow window = GetWindow <GameDataObjectEditorWindow>("Game Data Editor");

        window.serializedObject = new SerializedObject(o);
    }