public static PopupWindow ShowWin(Rect rect, PopupWindowContent content, bool isDrag = false, bool isCloseWhenLostFocus = false) { var popupWin = EditorWindow.GetWindow <PopupWindow>(); popupWin.Init(rect, content, isDrag, isCloseWhenLostFocus); return(popupWin); }
void OnDisable() { AssemblyReloadEvents.beforeAssemblyReload -= CloseWindow; if (windowContent != null) { windowContent.OnClose(); } windowContent = null; }
internal void Init(Rect rect, PopupWindowContent content, bool isDrag, bool isCloseWhenLostFocus) { hideFlags = HideFlags.DontSave; wantsMouseMove = true; windowContent = content; windowContent.Window = this; minSize = rect.size; position = rect; windowContent.OnOpen(); ShowPopup(); }