Skip to content

EffectPlaybackAsset

ClassTextStudioTextStudio
[CreateAssetMenu(fileName = "New Playback", menuName = "Text Studio/Animation/Effects/Playback", order = 4)]
public class EffectPlaybackAsset : ScriptableObject, IEffectPlayback

Reusable playback asset that maps elapsed time to normalized effect intensity with delay, looping, hold, and completion policy.

public float Evaluate(float time, float duration)

Evaluates normalized effect progress for an elapsed time and phase duration.

Parameters

Name Type Description
time System.Single Elapsed time in seconds.
duration System.Single Fallback forward duration in seconds.

Returns

System.Single: Normalized effect intensity.

public float Evaluate(float time, float duration, out bool complete)

Evaluates normalized intensity and reports whether finite playback has completed.

Parameters

Name Type
time System.Single
duration System.Single
complete System.Boolean

Returns

System.Single

public float GetTotalDuration(float duration = 0)

Calculates total playback time, including delays, holds, returns, and finite repeat cycles.

Parameters

Name Type
duration System.Single

Returns

System.Single: Total seconds, or positive infinity for unbounded playback.

public EffectPlaybackAsset()

public PlaybackMode Mode { get; }

Gets how local time is mapped to normalized effect intensity.

Returns

TextStudio.PlaybackMode

public float DelayBeforeStart { get; }

Returns

System.Single

public float Duration { get; }

Returns

System.Single

public float HoldDuration { get; }

Returns

System.Single

public float ReturnDuration { get; }

Returns

System.Single

public int CycleCount { get; }

Returns

System.Int32

public float DelayBetweenCycles { get; }

Returns

System.Single

public EffectPlaybackCompletion Completion { get; }

Returns

TextStudio.EffectPlaybackCompletion

public float ExternalPreviewValue { get; }

Returns

System.Single

public bool IsInfinite { get; }

Returns

System.Boolean