docs.unity3d.com
    Show / Hide Table of Contents

    Class Tray

    The Tray Popup class.

    Inheritance
    Object
    Popup
    Popup<Tray>
    Tray
    Inherited Members
    Popup<Tray>.m_LastFocusedElement
    Popup<Tray>.shown
    Popup<Tray>.dismissed
    Popup<Tray>.SetKeyboardDismiss(Boolean)
    Popup<Tray>.SetLastFocusedElement(Focusable)
    Popup<Tray>.InvokeShownEventHandlers()
    Popup.k_NextFrameDurationMs
    Popup.k_PopupShow
    Popup.k_PopupDismiss
    Popup.handler
    Popup.keyboardDismissEnabled
    Popup.view
    Popup.targetParent
    Popup.contentView
    Popup.context
    Popup.Dismiss()
    Popup.Dismiss(DismissType)
    Popup.Show()
    Popup.ShowView()
    Popup.OnViewKeyDown(KeyDownEvent)
    Popup.HideView(DismissType)
    Popup.FindSuitableParent(VisualElement)
    Object.ToString()
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Namespace: Unity.AppUI.UI
    Syntax
    public sealed class Tray : Popup<Tray>

    Methods

    AnimateViewIn()

    Start the animation for this popup.

    Declaration
    protected override void AnimateViewIn()
    Overrides
    Popup.AnimateViewIn()

    AnimateViewOut(DismissType)

    Start the hide animation for this popup.

    Declaration
    protected override void AnimateViewOut(DismissType reason)
    Parameters
    Type Name Description
    DismissType reason

    The reason why the popup should be dismissed.

    Overrides
    Popup.AnimateViewOut(DismissType)

    Build(VisualElement, VisualElement)

    Build a new Tray component.

    Declaration
    public static Tray Build(VisualElement referenceView, VisualElement content)
    Parameters
    Type Name Description
    VisualElement referenceView

    An arbitrary UI element inside the UI panel.

    VisualElement content

    The content to display inside this Tray.

    Returns
    Type Description
    Tray

    The Tray instance.

    GetFocusableElement()

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

    The default value is null.

    Declaration
    protected override VisualElement GetFocusableElement()
    Returns
    Type Description
    VisualElement

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

    Overrides
    Popup.GetFocusableElement()

    InvokeDismissedEventHandlers(DismissType)

    Called when the popup has been dismissed. This method will invoke any handlers attached to the dismissed event.

    Declaration
    protected override void InvokeDismissedEventHandlers(DismissType reason)
    Parameters
    Type Name Description
    DismissType reason
    Overrides
    Unity.AppUI.UI.Popup<Unity.AppUI.UI.Tray>.InvokeDismissedEventHandlers(Unity.AppUI.Core.DismissType)

    SetExpandable(Boolean)

    Set to true to make the tray expandable.

    Declaration
    public Tray SetExpandable(bool expandable)
    Parameters
    Type Name Description
    Boolean expandable

    True to make the tray expandable.

    Returns
    Type Description
    Tray

    The Tray instance.

    SetHandleVisible(Boolean)

    Set the handle visibility.

    Declaration
    public Tray SetHandleVisible(bool value)
    Parameters
    Type Name Description
    Boolean value

    The handle visibility.

    Returns
    Type Description
    Tray

    The Tray instance.

    SetMargin(Single)

    Set the margin of the tray.

    Declaration
    public Tray SetMargin(float margin)
    Parameters
    Type Name Description
    Single margin

    The margin of the tray.

    Returns
    Type Description
    Tray

    The Tray instance.

    SetPosition(TrayPosition)

    Build a new Tray component.

    Declaration
    public Tray SetPosition(TrayPosition position)
    Parameters
    Type Name Description
    TrayPosition position

    The position of the tray.

    Returns
    Type Description
    Tray

    The Tray instance.

    SetSize(Single)

    Set the size of the tray.

    Declaration
    public Tray SetSize(float size)
    Parameters
    Type Name Description
    Single size

    The size of the tray.

    Returns
    Type Description
    Tray

    The Tray instance.

    SetTransitionDuration(Int32)

    Set the transition duration.

    Declaration
    public Tray SetTransitionDuration(int durationMs)
    Parameters
    Type Name Description
    Int32 durationMs

    The transition duration in milliseconds.

    Returns
    Type Description
    Tray

    The Tray instance.

    ShouldAnimate()

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

    Declaration
    protected override bool ShouldAnimate()
    Returns
    Type Description
    Boolean

    True if you want to animate the popup, False otherwise.

    Overrides
    Popup.ShouldAnimate()

    ShouldDismiss(DismissType)

    Dismiss the Popup.

    Declaration
    protected override bool ShouldDismiss(DismissType reason)
    Parameters
    Type Name Description
    DismissType reason

    Why the element has been dismissed.

    Returns
    Type Description
    Boolean

    True if the element has been dismissed.

    Overrides
    Popup.ShouldDismiss(DismissType)
    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023