EditorWindow.cs 649 B

123456789101112131415161718192021222324
  1. using System;
  2. using System.Runtime.CompilerServices;
  3. using BansheeEngine;
  4. namespace BansheeEditor
  5. {
  6. public class EditorWindow : ScriptObject
  7. {
  8. protected EditorGUI GUI;
  9. public static EditorWindow OpenWindow<T>() where T : EditorWindow
  10. {
  11. return Internal_CreateOrGetInstance(typeof(T).Namespace, typeof(T).Name);
  12. }
  13. protected EditorWindow()
  14. {
  15. GUI = new EditorGUI(this);
  16. }
  17. [MethodImpl(MethodImplOptions.InternalCall)]
  18. private static extern EditorWindow Internal_CreateOrGetInstance(string ns, string typeName);
  19. }
  20. }