Struct TweenComponent
Data describing an active tween. Created by AddTween<T>(Entity, TypeManager.FieldInfo, T, T, Single, TweenFunc, LoopMode, Boolean, Single)
Once the tween is created, you can use callbacks in the Watcher module to watch for the current state of the tweening operation.
You can dynamically change values inside the TweenComponent at any time.
Namespace: Unity.Tiny.Tweens
Syntax
public struct TweenComponent : IComponentData
Fields
desc
Description of the tween, including the non-normalized time.
Declaration
public TweenDesc desc
Field Value
Type | Description |
---|---|
TweenDesc |
ended
True if the tween has stopped playing (t>duration).
Declaration
public bool ended
Field Value
Type | Description |
---|---|
System.Boolean |
Remarks
Never true if looping is continuous. You can use the Watcher module to watch this, and trigger a callback when the tween is finished playing.
loopCount
Number of times the tween has looped. You can use the Watcher module to watch this, and trigger a callback every loop.
Declaration
public int loopCount
Field Value
Type | Description |
---|---|
System.Int32 |
normalizedTweenTime
Current time of tween, normalized to [0..1] and with tween function applied. Only valid when the tween is running.
Declaration
public float normalizedTweenTime
Field Value
Type | Description |
---|---|
System.Single |
started
True if the tween has started playing (t>0) This can be watched using the Watcher module.
Declaration
public bool started
Field Value
Type | Description |
---|---|
System.Boolean |
target
Entity target to tween.
Declaration
public Entity target
Field Value
Type | Description |
---|---|
Entity |