Class BaseAsyncAffordanceStateReceiver<T>
Base implementation of an asynchronous affordance state receiver to be used with affordance types to tween using the job system.
Inheritance
Inherited Members
Namespace: UnityEngine.XR.Interaction.Toolkit.AffordanceSystem.Receiver
Assembly: Unity.XR.Interaction.Toolkit.dll
Syntax
public abstract class BaseAsyncAffordanceStateReceiver<T> : BaseAffordanceStateReceiver<T>, IAffordanceStateReceiver<T>, IAsyncAffordanceStateReceiver, IAffordanceStateReceiver where T : struct, IEquatable<T>
Type Parameters
Name | Description |
---|---|
T | The type of the value struct. |
Methods
HandleTween(float)
Called to generate and schedule a tween job with a given tween target.
Declaration
public JobHandle HandleTween(float tweenTarget)
Parameters
Type | Name | Description |
---|---|---|
float | tweenTarget | Tween target parameter for the tween job. Used as a parameter in the theme's animation curve to find the value between the 0-1 animation state in the associated theme. |
Returns
Type | Description |
---|---|
JobHandle | Returns |
OnAffordanceThemeChanged(BaseAffordanceTheme<T>)
Called when the affordance theme changes for this receiver, allowing proper setup to take place as a result.
Declaration
protected override void OnAffordanceThemeChanged(BaseAffordanceTheme<T> newValue)
Parameters
Type | Name | Description |
---|---|---|
BaseAffordanceTheme<T> | newValue | New affordance theme set for this receiver. |
Overrides
See Also
OnDestroy()
See MonoBehaviour.
Declaration
protected virtual void OnDestroy()
ScheduleTweenJob(ref TweenJobData<T>)
Generate the tween job from the given job data and schedule the job for execution on a worker thread.
Declaration
protected abstract JobHandle ScheduleTweenJob(ref TweenJobData<T> jobData)
Parameters
Type | Name | Description |
---|---|---|
TweenJobData<T> | jobData | Typed job data used in tween job. |
Returns
Type | Description |
---|---|
JobHandle | Returns the handle identifying the scheduled job. |
UpdateStateFromCompletedJob()
Read the affordance value written by the last completed affordance job and propagate that to listeners. Called by the affordance state provider to propagate the tween job's output.
Declaration
public void UpdateStateFromCompletedJob()