docs.unity3d.com
    Show / Hide Table of Contents

    Class PopupMenu

    Utility class to show and hide a Popup menu panel. Taken from Render Studio.

    Inheritance
    Object
    PopupMenu
    Namespace: Unity.Industrial.Forma.StandardUI
    Syntax
    public class PopupMenu

    Constructors

    PopupMenu(VisualElement, VisualElement, VisualElement, Vector2)

    Create a PopupMenu instance.

    Declaration
    public PopupMenu(VisualElement content, VisualElement treeRoot, VisualElement anchor = null, Vector2 offset = default(Vector2))
    Parameters
    Type Name Description
    VisualElement content

    The content that should be displayed as a popup.

    VisualElement treeRoot

    The popup hierarchy root. The PopupMenu hierarchy is added as a child to this element.

    VisualElement anchor

    The anchor for the element. If null, the PopupMenu will appear in the center of the screen

    Vector2 offset

    Offset from the anchor if any, or the center of the screen.

    Fields

    exitOnClickOut

    Close this menu if the user clicks outside it

    Declaration
    public bool exitOnClickOut
    Field Value
    Type Description
    Boolean

    Properties

    backDrop

    Backdrop UI element. This is a transparent element that covers the entire screen to catch clicks outside the menu.

    Declaration
    public VisualElement backDrop { get; }
    Property Value
    Type Description
    VisualElement

    bubbleTail

    Bubbletail VisualElement

    Declaration
    public VisualElement bubbleTail { get; }
    Property Value
    Type Description
    VisualElement

    bubbleTailPosition

    Bubble tail position

    Declaration
    public PopupMenu.BubbleTailPosition bubbleTailPosition { get; }
    Property Value
    Type Description
    PopupMenu.BubbleTailPosition

    container

    UI container

    Declaration
    public VisualElement container { get; }
    Property Value
    Type Description
    VisualElement

    isVisible

    Is menu visible?

    Declaration
    public bool isVisible { get; set; }
    Property Value
    Type Description
    Boolean

    treeRoot

    Visual tree root

    Declaration
    public VisualElement treeRoot { get; }
    Property Value
    Type Description
    VisualElement

    Methods

    Hide()

    Hide the Popup Menu. The content of the popup menu is not cleared here, to support animation in the future.

    Declaration
    public void Hide()

    Show()

    Show the Popup Menu.

    Declaration
    public void Show()

    Events

    visibilityChanged

    Visibility changed

    Declaration
    public event Action<bool> visibilityChanged
    Event Type
    Type Description
    Action<Boolean>
    Back to top
    Terms of use
    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