Class TweenSystem | Package Manager UI website
docs.unity3d.com
    Show / Hide Table of Contents

    Class TweenSystem

    A lightweight tweening system for component data.

    Inheritance
    System.Object
    TweenSystem
    Namespace: Unity.Tiny.Tweens
    Syntax
    public class TweenSystem : ComponentSystem
    Remarks

    Tweening makes it possible to easily change single values inside components over time without using a full animation system.

    Methods

    AddTween<T>(Entity, TypeManager.FieldInfo, T, T, Single, TweenFunc, LoopMode, Boolean, Single)

    Creates an Entity to tween a value over time.

    Declaration
    public Entity AddTween<T>(Entity target, TypeManager.FieldInfo info, T startValue, T endValue, float duration, TweenFunc func = TweenFunc.Smoothstep, LoopMode loop = LoopMode.Once, bool destroyWhenDone = true, float timeOffset = 0F)
    Parameters
    Type Name Description
    Entity target

    Entity where the component to be tweened is attached.

    TypeManager.FieldInfo info
    T startValue

    Starting point for the tween.

    T endValue

    Ending point for the tween.

    System.Single duration

    Time in seconds.

    TweenFunc func

    Tween function to use.

    LoopMode loop

    True to repeat the tween.

    System.Boolean destroyWhenDone

    True to cleanup after the tween.

    System.Single timeOffset

    Set to start from a non-zero time.

    Returns
    Type Description
    Entity
    Type Parameters
    Name Description
    T

    Type of the variable to tween.

    OnUpdate()

    Declaration
    protected override void OnUpdate()

    RemoveAllEndedTweens()

    Helper function that removes all tween entities that have stopped playing. You can use it to clean up after a level or transition sequence.

    Declaration
    public void RemoveAllEndedTweens()

    RemoveAllTweens(Entity)

    Helper function that removes all tween entities that reference target entity.

    Declaration
    public void RemoveAllTweens(Entity e)
    Parameters
    Type Name Description
    Entity e

    RemoveAllTweensInWorld()

    Helper function that removes all tween entities in the world. You can use it to clean up after a level.

    Declaration
    public void RemoveAllTweensInWorld()
    In This Article
    • Methods
      • AddTween<T>(Entity, TypeManager.FieldInfo, T, T, Single, TweenFunc, LoopMode, Boolean, Single)
      • OnUpdate()
      • RemoveAllEndedTweens()
      • RemoveAllTweens(Entity)
      • RemoveAllTweensInWorld()
    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