docs.unity3d.com
    Show / Hide Table of Contents

    Class TweenableVariableAsyncBase<T>

    Async implementation of base TweenableVariable. Uses affordance system jobs to asynchronously tween towards a target value.

    Inheritance
    Object
    BindableVariableBase<T>
    BindableVariable<T>
    TweenableVariableBase<T>
    TweenableVariableAsyncBase<T>
    ColorTweenableVariable
    FloatTweenableVariable
    Vector2TweenableVariable
    Vector3TweenableVariable
    Vector4TweenableVariable
    Inherited Members
    TweenableVariableBase<T>.k_NearlyOne
    TweenableVariableBase<T>.animationCurve
    TweenableVariableBase<T>.target
    TweenableVariableBase<T>.initialValue
    TweenableVariableBase<T>.HandleTween(Single)
    TweenableVariableBase<T>.StartAutoTween(Single)
    TweenableVariableBase<T>.PlaySequence(T, T, Single, Action)
    TweenableVariableBase<T>.OnTargetChanged(T)
    BindableVariable<T>.ValueEquals(T)
    BindableVariableBase<T>.SetValueWithoutNotify(T)
    BindableVariableBase<T>.Subscribe(Action<T>)
    BindableVariableBase<T>.SubscribeAndUpdate(Action<T>)
    BindableVariableBase<T>.Unsubscribe(Action<T>)
    BindableVariableBase<T>.BroadcastValue()
    BindableVariableBase<T>.Task(Func<T, Boolean>, CancellationToken)
    BindableVariableBase<T>.Task(T, CancellationToken)
    BindableVariableBase<T>.BindingCount
    Object.ToString()
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    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
    IDisposable.Dispose()

    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
    UnityEngine.XR.Interaction.Toolkit.Utilities.Tweenables.TweenableVariableBase<T>.ExecuteTween(T, T, System.Single, System.Boolean)
    See Also
    HandleTween(Single)

    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
    UnityEngine.XR.Interaction.Toolkit.Utilities.Tweenables.TweenableVariableBase<T>.OnAnimationCurveChanged(UnityEngine.AnimationCurve)
    See Also
    animationCurve

    PreprocessTween()

    Logic to execute before a tween can be processed.

    Declaration
    protected override void PreprocessTween()
    Overrides
    UnityEngine.XR.Interaction.Toolkit.Utilities.Tweenables.TweenableVariableBase<T>.PreprocessTween()

    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.

    See Also

    TweenableVariableSynchronousBase<T>
    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