{!See https://docs.google.com/document/d/1takg_GmIBBKKTj-GHZCwzxohpQz7Bhekivkk72kYMtE/edit for reference implementation of OneTrust, dataLayer and GTM} {!OneTrust Cookies Consent} {!OneTrust Cookies Consent end} {!dataLayer initialization push} {!dataLayer initialization push end} {!Google Tag Manager} {!Google Tag Manager end} Class Popup | App UI | 0.6.5
docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class Popup

    This is the base class for any UI component that needs to be displayed over the rest of the user interface.

    Inheritance
    object
    Popup
    Popup<T>
    Inherited Members
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    Namespace: Unity.AppUI.UI
    Assembly: solution.dll
    Syntax
    public abstract class Popup

    Constructors

    Name Description
    Popup(VisualElement, ApplicationContext, VisualElement, VisualElement)

    Default constructor.

    Fields

    Name Description
    k_NextFrameDurationMs

    The average duration of a frame in milliseconds. Used to delay position calculations.

    k_PopupDismiss

    The message id used to dismiss the popup.

    k_PopupShow

    The message id used to show the popup.

    Properties

    Name Description
    contentView

    The content of the popup.

    context

    The ApplicationContext linked to this popup.

    handler

    The handler that receives and dispatches messages. This is useful in multi-threaded applications.

    keyboardDismissEnabled

    True if the the popup can be dismissed by pressing the escape key or the return button on mobile, False otherwise.

    The default value is `True`.

    targetParent

    The parent of the view when the popup will be displayed.

    view

    Returns the popup's VisualElement.

    Methods

    Name Description
    AnimateViewIn()

    Start the animation for this popup.

    AnimateViewOut(DismissType)

    Start the hide animation for this popup.

    Dismiss()

    Dismiss the Popup.

    Dismiss(DismissType)

    Dismiss the Popup.

    FindSuitableParent(VisualElement)

    Find the parent VisualElement where the popup will be added. This is usually one of the layers from the Panel root UI element.

    GetFocusableElement()

    Returns the element that will be focused when the view will become visible.

    The default value is `null`.

    HideView(DismissType)

    Called when the popup's Handler has received a k_PopupDismiss message.

    InvokeDismissedEventHandlers(DismissType)

    Called when the popup has completed its dismiss process.

    InvokeShownEventHandlers()

    Called when the popup has become visible.

    OnViewKeyDown(KeyDownEvent)

    Called when the popup has received a KeyDownEvent.

    By default this method handles the dismiss of the popup via the Escape key or a Return button.

    ShouldAnimate()

    Implement this method to know if the popup should call AnimateViewIn() and AnimateViewOut(DismissType) methods or not.

    ShouldDismiss(DismissType)

    Check if the popup should be dismissed or not, depending on the reason.

    Show()

    Show the Popup.

    ShowView()

    Called when the popup's Handler has received a k_PopupShow message. In this method the view should become visible at some point (directly or via an animation).

    In This Article
    Back to top
    Copyright © 2023 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)