RuntimeTextureArrayLoaderEditor.cs 750 B

1234567891011121314151617181920212223242526
  1. using UnityEditor;
  2. using UnityEngine;
  3. namespace MTE
  4. {
  5. [CustomEditor(typeof(RuntimeTextureArrayLoader))]
  6. public class RuntimeTextureArrayLoaderEditor : Editor
  7. {
  8. public override void OnInspectorGUI()
  9. {
  10. base.OnInspectorGUI();
  11. if (GUILayout.Button("Load"))
  12. {
  13. var loader = target as RuntimeTextureArrayLoader;
  14. System.Diagnostics.Debug.Assert(loader);
  15. loader.LoadInEditor();
  16. }
  17. if (GUILayout.Button("Unload"))
  18. {
  19. var loader = target as RuntimeTextureArrayLoader;
  20. System.Diagnostics.Debug.Assert(loader);
  21. loader.UnloadInEditor();
  22. }
  23. }
  24. }
  25. }