![]() Hopefully Unity will update the documentation to make distinctions and examples more clear. Adding to the confusion, EditorWindow.ShowAsDropDown also exists and does nearly the exact same t$$anonymous$$ng as ShowPopup. These all appear to do somet$$anonymous$$ng very similar: create a hovering context that's locked to a specific location (or GUI Control). Another possibly(?) related and definite shortcut would be EditorGUI.Popup. T$$anonymous$$s is accomplished by calling the EditorWindow.ShowUtility method (there's an example in the documentation at that link).Īs a clarification regarding the PopupWindow system, it appears to be linked to the EditorWindow.ShowPopup method call a shortcut, if you will. The best way to do t$$anonymous$$s (see: Color Picker or Object Picker popup windows) is to create a new Utility Window and have it interact with the main window. var backgroundButton new Button () new StyleEnum < Position >( Position.Has anyone else accomplished somet$$anonymous$$ng like t$$anonymous$$s? Does anyone have any ideas on how to do t$$anonymous$$s? new StyleLength (new Length (100, LengthUnit.Percent)) //Popup background is button so that the popup is closed when the player //clicks anywhere outside the popup. NOTE: #1 above would create a pop-up that cannot leave the EditorWindow and #2 would create a pop-up that's separate from the EditorWindow. I always get an exception of the type UnityEngine.ExitGUIException, regardless of whether I call it in OnEnable, OnGUI, or Update. I subclassed PopupWindowContent and used PopupWindow.Show to display it. PopupWindow.Show - I attempted to use the poorly documented PopupWindow system. I assume that () does somet$$anonymous$$ng internally other than change the type. I then tried overriding at the beginning if it was a mouse event wit$$anonymous$$n the window's Rect and then reset it right before the GUILayout.Window call but that didn't work either. So I attempted to move the code to the top of my OnGUI call but that didn't work because the popup started drawing below the normal controls. T$$anonymous$$s worked well until I realized that if it was positioned over other controls, those would take precedence because of how the IMGUI event system handles input. GUILayout.Window - I attempted to use the GUILayout.Window function. I've tried two separate ways so far but to no avail. new StyleLength (new Length (100, LengthUnit.Percent)) //Popup background is button so that the popup is closed when the player //clicks anywhere outside the popup. madewithunity unit圓d unity indiegame gamedevelopment gamedevThe Right way to make a cool Dialog UI Popup, and re-use it in your other projects easily. Somet$$anonymous$$ng like the built-in AnimationCurve Editor Window. I'm trying to create a sub-window for an EditorWindow that the user can move around.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |