docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Struct EventBinding

    Container struct holding a bind and unbind action. Useful for storing bind and unbind actions at the point of registration to avoid keeping track of the binding signature, and works with anonymous functions.

    Implements
    IEventBinding
    Inherited Members
    ValueType.Equals(object)
    ValueType.GetHashCode()
    ValueType.ToString()
    object.Equals(object, object)
    object.GetType()
    object.ReferenceEquals(object, object)
    Namespace: Unity.XR.CoreUtils.Bindings
    Assembly: Unity.XR.CoreUtils.dll
    Syntax
    public struct EventBinding : IEventBinding

    Constructors

    EventBinding(Action, Action)

    Create an event binding container.

    Declaration
    public EventBinding(Action bindAction, Action unBindAction)
    Parameters
    Type Name Description
    Action bindAction

    Action to initiate Bind() (subscribe).

    Action unBindAction

    Action to initiate Unbind() (unsubscribe).

    Properties

    BindAction

    Action to bind to callback.

    Declaration
    public Action BindAction { readonly get; set; }
    Property Value
    Type Description
    Action

    IsBound

    True if Bind function was called and binding is currently active.

    Declaration
    public bool IsBound { get; }
    Property Value
    Type Description
    bool

    UnbindAction

    Action to unbind from callback.

    Declaration
    public Action UnbindAction { readonly get; set; }
    Property Value
    Type Description
    Action

    Methods

    Bind()

    Trigger binding action.

    Declaration
    public void Bind()

    ClearBinding()

    Trigger unbinding action and then destroy all binding action references.

    Declaration
    public void ClearBinding()

    Unbind()

    Trigger unbinding action.

    Declaration
    public void Unbind()

    Implements

    IEventBinding
    In This Article
    Back to top
    Copyright © 2025 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)