/// <summary> Resets this UIPopup's DisplayTarget to the PopupCanvas (the default canvas used for all UIPopups) </summary> /// <param name="reparentImmediately"> Should this UIPopup also get re-parented to the PopupCanvas? </param> public void ResetTargetCanvasToPopupCanvas(bool reparentImmediately = true) { DisplayTarget = PopupDisplayOn.PopupCanvas; if (reparentImmediately) { ReparentToPopupCanvas(); } }
/// <summary> Sets a new target canvas name and also re-parents this UIPopup under it (if the option is enabled) </summary> /// <param name="canvasName"> The new target canvas name what will be used by this UIPopup when shown </param> /// <param name="reparentImmediately"> Should this UIPopup also get re-parented to the new target canvas? </param> public void SetTargetCanvasName(string canvasName, bool reparentImmediately = true) { DisplayTarget = PopupDisplayOn.TargetCanvas; CanvasName = canvasName; if (reparentImmediately) { ReparentToTargetCanvas(); } if (DebugComponent) { DDebug.Log("Set Target Canvas Name: " + canvasName, this); } }
private void Reset() { AddToPopupQueue = ADD_TO_POPUP_QUEUE_DEFAULT_VALUE; AutoHideAfterShow = AUTO_HIDE_AFTER_SHOW_DEFAULT_VALUE; AutoHideAfterShowDelay = AUTO_HIDE_AFTER_SHOW_DELAY_DEFAULT_VALUE; AutoSelectButtonAfterShow = AUTO_SELECT_BUTTON_AFTER_SHOW_DEFAULT_VALUE; CanvasName = UIPopup.DefaultTargetCanvasName; CustomCanvasName = CUSTOM_CANVAS_NAME_DEFAULT_VALUE; DestroyAfterHide = DESTROY_AFTER_HIDE_DEFAULT_VALUE; DisplayTarget = DISPLAY_ON_DEFAULT_VALUE; HideOnBackButton = HIDE_ON_BACK_BUTTON_DEFAULT_VALUE; HideOnClickAnywhere = HIDE_ON_CLICK_ANYWHERE_DEFAULT_VALUE; HideOnClickContainer = HIDE_ON_CLICK_CONTAINER_DEFAULT_VALUE; HideOnClickOverlay = HIDE_ON_CLICK_OVERLAY_DEFAULT_VALUE; UpdateHideProgressorOnShow = UPDATE_HIDE_PROGRESSOR_ON_SHOW_DEFAULT_VALUE; UpdateShowProgressorOnHide = UPDATE_SHOW_PROGRESSOR_ON_HIDE_DEFAULT_VALUE; UseOverlay = USE_OVERLAY_DEFAULT_VALUE; }
/// <summary> Returns either the UICanvas named 'PopupCanvas' (if PopupDisplayOn.PopupCanvas) or another UICanvas with the target canvas name </summary> /// <param name="popupDisplayOn"> Where should the UIPopup be shown </param> /// <param name="targetCanvasName"> Target canvas name (used if PopupDisplayOn.TargetCanvas) </param> public static UICanvas GetTargetCanvas(PopupDisplayOn popupDisplayOn, string targetCanvasName) { return(popupDisplayOn == PopupDisplayOn.PopupCanvas ? GetPopupOverlayCanvas() : UICanvas.GetUICanvas(targetCanvasName)); }