Class BaseAffordanceStateProvider
Base state machine for scheduling tween jobs on registered receivers. Starts when affordance state updates and new tweens need computing. Stops when transitions are complete.
Inherited Members
Namespace: UnityEngine.XR.Interaction.Toolkit.AffordanceSystem.State
Assembly: Unity.XR.Interaction.Toolkit.dll
Syntax
public abstract class BaseAffordanceStateProvider : MonoBehaviour
Properties
currentAffordanceStateData
Bindable variable holding the affordance state data which is propagated to affordance receivers when changed.
Declaration
public IReadOnlyBindableVariable<AffordanceStateData> currentAffordanceStateData { get; }
Property Value
Type | Description |
---|---|
IReadOnlyBindableVariable<AffordanceStateData> |
See Also
isCurrentlyTransitioning
Returns true if last transition is complete.
Declaration
public bool isCurrentlyTransitioning { get; }
Property Value
Type | Description |
---|---|
bool |
transitionDuration
Duration of transition in seconds. 0
means no smoothing.
Declaration
public float transitionDuration { get; set; }
Property Value
Type | Description |
---|---|
float |
Methods
AddBinding(IEventBinding)
Register binding to the binding group.
Declaration
protected void AddBinding(IEventBinding binding)
Parameters
Type | Name | Description |
---|---|---|
IEventBinding | binding | Binding to register. |
See Also
BindToProviders()
Inform all registered receivers of the current affordance state data and subscribe to changes of the affordance state.
Declaration
protected virtual void BindToProviders()
Remarks
This method is automatically called by Unity when this component is enabled.
See Also
ClearBindings()
Triggers unbind action on all bindings and destroys all stored binding actions, as well as clears the group of all registered bindings.
Declaration
protected virtual void ClearBindings()
Remarks
This method is automatically called by Unity when this component is disabled.
OnDisable()
See MonoBehaviour.
Declaration
protected virtual void OnDisable()
OnEnable()
See MonoBehaviour.
Declaration
protected virtual void OnEnable()
OnValidate()
See MonoBehaviour.
Declaration
protected virtual void OnValidate()
RegisterAffordanceReceiver(IAffordanceStateReceiver)
Entry point for receivers to register themselves to have their tween jobs scheduled.
Declaration
public bool RegisterAffordanceReceiver(IAffordanceStateReceiver receiver)
Parameters
Type | Name | Description |
---|---|---|
IAffordanceStateReceiver | receiver | Receiver to register. |
Returns
Type | Description |
---|---|
bool | Returns true if receiver was newly registered as a result of this method. Otherwise, returns false if already registered. |
UnregisterAffordanceReceiver(IAffordanceStateReceiver)
Entry point for receivers to unregister themselves from having their tween jobs scheduled. Calling this will also force complete any outstanding jobs if it is an asynchronous receiver.
Declaration
public bool UnregisterAffordanceReceiver(IAffordanceStateReceiver receiver)
Parameters
Type | Name | Description |
---|---|---|
IAffordanceStateReceiver | receiver | Receiver to unregister. |
Returns
Type | Description |
---|---|
bool | Returns true if receiver was newly unregistered as a result of this method. Otherwise, returns false if already unregistered. |
Update()
See MonoBehaviour.
Declaration
protected virtual void Update()
UpdateAffordanceState(AffordanceStateData)
Externally control the affordance state used as a target for affordance receivers. Useful especially in the process of networking affordance states.
Declaration
public void UpdateAffordanceState(AffordanceStateData newAffordanceStateData)
Parameters
Type | Name | Description |
---|---|---|
AffordanceStateData | newAffordanceStateData | New affordance state target. |