public override void DoGUI() { bool was = PressedVisible; base.DoGUI(); if (Event.current.type == EventType.Repaint) { Rect r = GUILayoutUtility.GetLastRect(); popupRect.position = GUIUtility.GUIToScreenPoint(r.position) + new Vector2(0, r.height); popupRect.width = r.width; popupRect.height = CalcPopupViewHeight(); } if (was != PressedVisible) { GUIWidgets gui = FindGUI(); if (gui != null) { if (PressedVisible) { gui.SetCurrentPopup(this); } else { gui.UnsetCurrentPopup(this); } } } }
public void PopDown() { SetPressedVisible(false); GUIWidgets gui = FindGUI(); if (gui != null) { gui.UnsetCurrentPopup(this); } }