using Sirenix.OdinInspector.Editor; using UnityEditor; using UnityEngine; namespace UguiToolkit.Editor.Windows { public abstract class BaseWindow : OdinEditorWindow, IWindow where T : OdinEditorWindow, IWindow { private static T m_window; public static T Window => m_window; public static T ShowWindow(WindowArgs args = null) { if (m_window) m_window.Close(); m_window = CreateWindow(); m_window.titleContent = new(m_window.GettitleContent()); m_window.Show(); m_window.Init(args); return m_window; } public static void CloseWindow() { if (m_window) { m_window.Close(); m_window = null; } } public virtual string GettitleContent() => ""; public virtual void Init(WindowArgs args = null) { } } public interface IWindow { string GettitleContent(); void Init(WindowArgs args = null); } public class WindowArgs { } }