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
System.ValueType.GetHashCode()
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
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
ClearBinding()
Trigger unbinding action and then destroy all binding action references.
Declaration
public void ClearBinding()
Implements
Unbind()
Trigger unbinding action.
Declaration
public void Unbind()