Exemple #1
0
        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);
        }
Exemple #2
0
 void OnDisable()
 {
     AssemblyReloadEvents.beforeAssemblyReload -= CloseWindow;
     if (windowContent != null)
     {
         windowContent.OnClose();
     }
     windowContent = null;
 }
Exemple #3
0
        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();
        }