docs.unity3d.com
    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.

    Inherited Members
    ValueType.Equals(Object)
    System.ValueType.GetHashCode()
    ValueType.ToString()
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetType()
    Namespace: Unity.XR.CoreUtils.Bindings
    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 readonly bool IsBound { get; }
    Property Value
    Type Description
    Boolean
    Implements
    IEventBinding.IsBound

    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()
    Implements
    IEventBinding.Bind()

    ClearBinding()

    Trigger unbinding action and then destroy all binding action references.

    Declaration
    public void ClearBinding()
    Implements
    IEventBinding.ClearBinding()

    Unbind()

    Trigger unbinding action.

    Declaration
    public void Unbind()
    Implements
    IEventBinding.Unbind()
    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