docs.unity3d.com
Search Results for

    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
    Implements
    IReadOnlyBindableVariable<T>
    IDisposable
    Inherited Members
    TweenableVariableBase<T>.k_NearlyOne
    TweenableVariableBase<T>.animationCurve
    TweenableVariableBase<T>.target
    TweenableVariableBase<T>.initialValue
    TweenableVariableBase<T>.HandleTween(float)
    TweenableVariableBase<T>.StartAutoTween(float)
    TweenableVariableBase<T>.PlaySequence(T, T, float, Action)
    TweenableVariableBase<T>.OnTargetChanged(T)
    BindableVariable<T>.ValueEquals(T)
    BindableVariableBase<T>.BindingCount
    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, bool>, CancellationToken)
    BindableVariableBase<T>.Task(T, CancellationToken)
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: UnityEngine.XR.Interaction.Toolkit.Utilities.Tweenables
    Assembly: Unity.XR.Interaction.Toolkit.dll
    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
    See Also
    TweenableVariableSynchronousBase<T>

    Methods

    Dispose()

    Free up allocated memory.

    Declaration
    public void Dispose()
    See Also
    TweenableVariableSynchronousBase<T>

    ExecuteTween(T, T, float, bool)

    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.

    float tweenAmount

    Value between 0-1 used in tween evaluation.

    bool useCurve

    Whether the animation curve should be used in the tween evaluation.

    Overrides
    TweenableVariableBase<T>.ExecuteTween(T, T, float, bool)
    See Also
    HandleTween(float)

    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
    TweenableVariableBase<T>.OnAnimationCurveChanged(AnimationCurve)
    See Also
    animationCurve

    PreprocessTween()

    Logic to execute before a tween can be processed.

    Declaration
    protected override void PreprocessTween()
    Overrides
    TweenableVariableBase<T>.PreprocessTween()
    See Also
    TweenableVariableSynchronousBase<T>

    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>

    Implements

    Unity.XR.CoreUtils.Bindings.Variables.IReadOnlyBindableVariable<T>
    IDisposable

    See Also

    TweenableVariableSynchronousBase<T>
    In This Article
    Back to top
    Copyright © 2024 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)