private void OnDisable() { this.onDefineOrientation = null; this.onDefineOrientation2 = null; if (OwnerWindow != null) { OwnerWindow.Repaint(); OwnerWindow = null; } }
/// <summary> /// Show define orientation window as drop-down. /// </summary> /// <param name="buttonRect">Rectangle of button in screen space.</param> /// <param name="title">Title text for drop-down.</param> /// <param name="callback">Invoked when orientation is defined.</param> internal static void ShowAsDropDown(Rect buttonRect, string title, DefineOrientationDelegate2 callback) { Init(234); Instance.onDefineOrientation = null; Instance.onDefineOrientation2 = callback; Instance.ShownAsDropDown = true; Instance.titleContent.text = title; Instance.ShowAsDropDown(buttonRect, new Vector2(325, 234)); }
/// <summary> /// Display orientation selection window. /// </summary> /// <param name="callback">Invoked when orientation is defined.</param> /// <returns> /// The window. /// </returns> public static DefineOrientationWindow ShowWindow(DefineOrientationDelegate2 callback) { return(ShowWindow(TileLang.ParticularText("Action", "Select Orientation"), callback)); }
/// <summary> /// Display define orientation selection window with custom title. /// </summary> /// <param name="title">Title for window.</param> /// <param name="callback">Invoked when orientation is defined.</param> /// <returns> /// The window. /// </returns> public static DefineOrientationWindow ShowWindow(string title, DefineOrientationDelegate2 callback) { DoShowWindow(title); Instance.onDefineOrientation2 = callback; return(Instance); }