// Shown on top of any previous windows internal static void Show(Rect activatorRect, PopupWindowContent windowContent, PopupLocation[] locationPriorityOrder, ShowMode showMode) { // If we already have a popup window showing this type of content, then just close // the existing one. var existingWindows = Resources.FindObjectsOfTypeAll(typeof(PopupWindow)); if (existingWindows != null && existingWindows.Length > 0) { var existingPopup = existingWindows[0] as PopupWindow; if (existingPopup != null && existingPopup.m_WindowContent != null && windowContent != null) { if (existingPopup.m_WindowContent.GetType() == windowContent.GetType()) { existingPopup.CloseWindow(); return; } } } if (ShouldShowWindow(activatorRect)) { PopupWindow win = CreateInstance <PopupWindow>(); if (win != null) { win.Init(activatorRect, windowContent, locationPriorityOrder, showMode, true); } if (Event.current != null) { EditorGUIUtility.ExitGUI(); // Needed to prevent GUILayout errors on OSX } } }
// Shown on top of any previous windows internal static void Show(Rect activatorRect, PopupWindowContent windowContent, PopupLocation[] locationPriorityOrder, ShowMode showMode) { if (ShouldShowWindow(activatorRect)) { PopupWindow win = CreateInstance <PopupWindow>(); if (win != null) { win.Init(activatorRect, windowContent, locationPriorityOrder, showMode, true); } EditorGUIUtility.ExitGUI(); // Needed to prevent GUILayout errors on OSX } }
internal static void Show(Rect activatorRect, PopupWindowContent windowContent, PopupLocationHelper.PopupLocation[] locationPriorityOrder, ShowMode showMode) { if (PopupWindow.ShouldShowWindow(activatorRect)) { PopupWindow popupWindow = ScriptableObject.CreateInstance <PopupWindow>(); if (popupWindow != null) { popupWindow.Init(activatorRect, windowContent, locationPriorityOrder, showMode); } GUIUtility.ExitGUI(); } }
internal static void Show(Rect activatorRect, PopupWindowContent windowContent, PopupLocationHelper.PopupLocation[] locationPriorityOrder) { if (!PopupWindow.ShouldShowWindow(activatorRect)) { return; } PopupWindow instance = ScriptableObject.CreateInstance <PopupWindow>(); if ((Object)instance != (Object)null) { instance.Init(activatorRect, windowContent, locationPriorityOrder); } GUIUtility.ExitGUI(); }