Class TweenableVariableAsyncBase<T>
Async implementation of base TweenableVariable. Uses affordance system jobs to asynchronously tween towards a target value.
Inheritance
Inherited Members
Namespace: UnityEngine.XR.Interaction.Toolkit.Utilities.Tweenables
Syntax
public abstract class TweenableVariableAsyncBase<T> : TweenableVariableBase<T>, IReadOnlyBindableVariable<T>, IDisposable where T : struct, IEquatable<T>
Type Parameters
Name | Description |
---|---|
T | BindableVariable type. |
Remarks
While the destructor of this class should be able to automatically dispose of allocated resources, it is best practice to manually call dispose when instances are no longer needed.
Properties
Value
The internal tweenable variable value. When setting the value, subscribers may be notified. If any async jobs are pending, they will be completed and the state will sync up. The subscribers will not be notified if this variable is initialized, is configured to check for equality, and the new value is equivalent.
Declaration
public T Value { get; set; }
Property Value
Type | Description |
---|---|
T |
Methods
Dispose()
Free up allocated memory.
Declaration
public void Dispose()
Implements
ExecuteTween(T, T, Single, Boolean)
Tween from current value to target using tween target.
Declaration
protected override void ExecuteTween(T startValue, T targetValue, float tweenAmount, bool useCurve = false)
Parameters
Type | Name | Description |
---|---|---|
T | startValue | Tween starting value. |
T | targetValue | Tween target value. |
Single | tweenAmount | Value between 0-1 used in tween evaluation. |
Boolean | useCurve | Whether the animation curve should be used in the tween evaluation. |
Overrides
See Also
OnAnimationCurveChanged(AnimationCurve)
Called when the animation curve reference used for sequence animations changed.
Declaration
protected override void OnAnimationCurveChanged(AnimationCurve value)
Parameters
Type | Name | Description |
---|---|---|
AnimationCurve | value | The new value of the property. |
Overrides
See Also
PreprocessTween()
Logic to execute before a tween can be processed.
Declaration
protected override void PreprocessTween()
Overrides
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. |