Example #1
0
    public override void OnInspectorGUI()
    {
        base.DrawDefaultInspector();

        RoomLoader loader = (RoomLoader)target;

        if (GUILayout.Button("Unserialize"))
        {
            Undo.RecordObject(loader, "Unserialize Room");
            loader.Unserialize(loader.currentRoom);
        }

        if (GUILayout.Button("Serialize"))
        {
            EditorUtility.SetDirty(loader.currentRoom);

            Undo.RecordObject(loader.currentRoom, "Serialize Room");
            loader.Serialize();

            AssetDatabase.SaveAssets();
            AssetDatabase.Refresh();
        }
    }