UIPopup

class in Doozy.Engine.UI / Inherits from UIComponentBase

Description

The UIPopup is a core component in the DoozyUI system that works and behaves like a pop-up window. It appears superimposed over everything and without the user explicitly triggering it.

It works as a modal window that can force the user to interact with it before they can go back to using the parent application.

UIPopups are sometimes called heavy windows or modal dialogs because they often display a dialog box that communicates information to the user and prompts them for a response.

Static Properties

  • public static bool AnyPopupVisible – Returns TRUE if an UIPopup is currently visible

  • public static string DefaultPopupName – Default UIPopup popup name

  • public static string DefaultTargetCanvasName – Default UIPopup target canvas name

  • public static UIPopup LastShownPopup – Returns last entry in the VisiblePopups list. If the list is empty, it returns null

  • public static Action<UIPopup, AnimationType> OnUIPopupAction – Action invoked whenever an UIPopupBehavior is triggered

  • public static readonly List VisiblePopups – List of all the popups that are currently visible on screen

Properties

  • public bool AddedToQueue – Returns TRUE if the UIPopupManager has marked this UIPopup as being in the PopupQueue

  • public Canvas Canvas – Reference to the Canvas component

  • public bool DetectsTouch – Returns TRUE if either HideOnClickAnywhere, or HasOverlay and HideOnClickOverlay, or HasContainer and HideOnClickContainer are true

  • public GraphicRaycaster GraphicRaycaster – Reference to the GraphicRaycaster component

  • public bool HasContainer – Returns TRUE if this UIPopup has a valid UIContainer Container

  • public bool HasOverlay – Returns TRUE if this UIPopup has a valid UIContainer Overlay

  • public float InverseVisibility – Returns the inverse of the current Visibility value (float between 1 and 0) (NotVisible – Visible)

  • public bool IsHidden – Returns TRUE if this UIPopup is NOT visible (is NOT in view)

  • public bool IsHiding – Returns TRUE if this UIPopup is playing the Hide Animation to get out of view

  • public bool IsShowing – Returns TRUE if this UIPopup is playing the Show Animation to become visible

  • public bool IsVisible – Returns TRUE if this UIPopup is visible (is in view)

  • public string PopupName – Set by the UIPopupManager when this UIPopup (clone) is created (from the prefab). Used for identification purposes

  • public VisibilityState Visibility – The current visibility state of this UIPopup (Visible, NotVisible, Hiding or Showing)

  • public float VisibilityProgress – The visibility value of this UIPopup (float between 0 and 1) (NotVisible – Visible)

Public Variables

  • public bool AddToPopupQueue – Should this popup be added to the PopupQueue? By adding this popup to the PopupQueue means that if another UIPopup is currently visible, then this UIPopup will appear only after that one has been closed.

  • public bool AutoHideAfterShow – If TRUE, after this UIPopup gets shown, it will get automatically hidden after the AutoHideAfterShowDelay time interval has passed

  • public float AutoHideAfterShowDelay – If AutoHideAfterShow is TRUE, this is the time interval after which this UIPopup will get automatically hidden

  • public bool AutoSelectButtonAfterShow – If TRUE, after this UIPopup has been shown, the referenced SelectedButton GameObject will get automatically selected by EventSystem.current

  • public string CanvasName – The implicit target UICanvas where this UIPopup will be shown

  • public UIContainer Container – UIDrawer container settings. This is the actual popup that gets animated

  • public bool CustomCanvasName – Internal variable used by the custom inspector to allow you to type a custom canvas name instead of selecting it from the database

  • public UIPopupContentReferences Data – References to components can be customized (Labels, Images and Buttons)

  • public bool DestroyAfterHide – Should this UIPopup get automatically destroyed after being hidden (default: TRUE)

  • public PopupDisplayOn DisplayTarget – Determines if this UIPopup should be displayed on the PopupCanvas or on a specific target canvas

  • public UIPopupBehavior HideBehavior – Behavior when this UIPopup gets hidden (goes off screen)

  • public bool HideOnBackButton – If TRUE, the next ‘Back’ button event will hide (close) this UIPopup (default: TRUE)

  • public bool HideOnClickAnywhere – If TRUE, the next click (anywhere on screen) will hide (close) this UIPopup (default: FALSE)

  • public bool HideOnClickContainer – If TRUE, the next click (on the Container) will hide (close) this UIPopup (default: TRUE)

  • public bool HideOnClickOverlay – If TRUE, the next click (on the Overlay) will hide (close) this UIPopup (default: TRUE)

  • public Progressor HideProgressor – Reference to a Progressor that allows animating anything (texts, images, animations…) while hiding this UIPopup

  • public ProgressEvent OnInverseVisibilityChanged – Callback executed when the popup is animating (showing or hiding) and the progress has been updated. Passes the InverseVisibility (float between 1 – NotVisible and 0 – Visible). InverseVisibility = 1 – Visibility

  • public ProgressEvent OnVisibilityChanged – Callback executed when the popup is animating (showing or hiding) and the progress has been updated. Passes the Visibility (float between 0 – NotVisible and 1 – Visible)

  • public UIContainer Overlay – Settings for the Overlay UIContainer used to dim the screen when the this UIPopup is shown. This is the popup’s background that gets faded in/out. Its effect is to tint the screen by being drawn (sorted) behind the UIContainer Container

  • public GameObject SelectedButton – Reference to the GameObject that should be selected after this UIPopup has been shown. Works only if AutoSelectButtonAfterShow is TRUE

  • public UIPopupBehavior ShowBehavior – Behavior when this UIPopup gets shown (becomes visible on screen)

  • public Progressor ShowProgressor – Reference to a Progressor that allows animating anything (texts, images, animations…) while showing this UIPopup

  • public bool UpdateHideProgressorOnShow – Should the HideProgressor get updated when this UIPopup is showing?

  • public bool UpdateShowProgressorOnHide – Should the ShowProgressor get updated when this UIPopup is hiding?

  • public bool UseOverlay – Should this UIPopup use the Overlay

Public Methods

  • public void CancelAutoHide() – Cancels an auto hide, if it was initiated

  • public UICanvas GetTargetCanvas() – Returns the TargetCanvas designated for this UIPopup

  • public void Hide(float delay) – Hides this UIPopup after the set delay

  • public void Hide(bool instantAction = false) – Hides this UIPopup

  • public void ResetTargetCanvasToPopupCanvas(bool reparentImmediately = true) – Resets this UIPopup’s DisplayTarget to the PopupCanvas (the default canvas used for all UIPopups)

  • public void Show(bool instantAction = false) – Shows this UIPopup

  • public void NotifySystemOfTriggeredBehavior(AnimationType animationType) – Sends an UIPopupMessage notifying the system that an UIPopupBehavior has been triggered

  • public void SetPopupName(string popupName) – Sets the PopupName property. Used by the UIPopupManager to identify this UIPopup

  • public void SetTargetCanvasName(string canvasName, bool reparentImmediately = true) – Sets a new target canvas name and also re-parents this UIPopup under it (if the option is enabled)

Static Methods

  • public static UIPopup GetPopup(string popupName) – Looks in the UIPopupManager PopupsDatabase for an UIPopup prefab linked to the given popup name. If found, it instantiates a clone of it and returns a reference to it. Otherwise it returns null

  • public static UICanvas GetPopupOverlayCanvas() – Returns the UICanvas named ‘PopupCanvas’ and sets its render mode to ScreenSpaceOverlay

  • public static UICanvas GetTargetCanvas(PopupDisplayOn popupDisplayOn, string targetCanvasName) – Returns either the UICanvas named ‘PopupCanvas’ (if PopupDisplayOn.PopupCanvas) or another UICanvas with the target canvas name

  • public static bool HidePopup(string popupName, bool instantAction = false) – Hides any UIPopup that has the given popup name

  • private static void RemoveHiddenFromVisiblePopups() – Removes any UIPopups set as hidden from the VisiblePopups list

  • private static void RemoveNullsFromVisiblePopups() – Removes any null entries from the VisiblePopups list