Example #1
0
        private static void ShowSelectableGameObjectsPopup(Rect rect, List <GameObject> options)
        {
#if UNITY_2019_3_OR_NEWER
            var popup   = EditorWindow.CreateInstance <UIE_PopupWindow>();
            var content = new UIE_PopupWindowContent(options, popup);
            popup.Show(rect, content);
#else
            var content = new IMGUI_SelectionPopup(options);
            UnityEditor.PopupWindow.Show(rect, content);
#endif
        }
Example #2
0
        public void Show(Rect activatorRect, UIE_PopupWindowContent content)
        {
            base.hideFlags      = HideFlags.DontSave;
            base.wantsMouseMove = true;

            this.content = content;

            Vector2 size = content.GetWindowSize();

            content.Build(rootVisualElement);

            activatorRect = GUIUtility.GUIToScreenRect(activatorRect);
            base.ShowAsDropDown(activatorRect, size);
        }