Skip to content

EffectEvaluationContext

StructTextStudioTextStudio
public readonly struct EffectEvaluationContext

Context passed to effect evaluation. Contains all timing and effect area information needed for effect computation without accessing global state.

public readonly int glyphIndex

Index of the glyph within visible glyph array.

Returns

System.Int32

public readonly int totalGlyphs

Total visible glyph count.

Returns

System.Int32

public readonly int wordIndex

Word index the glyph belongs to.

Returns

System.Int32

public readonly int lineIndex

Line index the glyph belongs to.

Returns

System.Int32

public readonly AnimationPhase phase

Current animation phase for this glyph.

Returns

TextStudio.AnimationPhase

public readonly float phaseProgress

Progress within the current phase (0–1).

Returns

System.Single

public readonly float time

Time since text controller started (seconds).

Returns

System.Single

public readonly float playbackTime

Time since the current effect invocation started (seconds). This normally matches TextStudio.EffectEvaluationContext.time, but previews may restart finite playback without resetting the continuous clock used by oscillators and procedural motion.

Returns

System.Single

public readonly float deltaTime

Delta time since last evaluation (seconds).

Returns

System.Single

public readonly float normalizedIndex

Normalized position of glyph within the current effect binding (0–1).

Returns

System.Single

public readonly TextStudioEffectAreaMode area

Returns

TextStudio.TextStudioEffectAreaMode

public readonly int groupSize

Returns

System.Int32

public readonly int unitIndex

Returns

System.Int32

public readonly int unitCount

Returns

System.Int32

public readonly int unitStartGlyph

Returns

System.Int32

public readonly int unitGlyphCount

Returns

System.Int32

public readonly int indexInUnit

Returns

System.Int32

public readonly float normalizedIndexInUnit

Returns

System.Single

public readonly float normalizedUnitIndex

Returns

System.Single

public readonly float normalizedIndexInBinding

Returns

System.Single

public readonly int randomSeedIndex

Returns

System.Int32

public readonly float playbackOffset

Returns

System.Single

public readonly Vector3 sourcePosition

Glyph center from the source TMP layout, before placement.

Returns

UnityEngine.Vector3

public readonly Vector3 sourceTextNormalizedPosition

Glyph center normalized inside the complete source-text visual bounds. This remains stable when placement, animation, or object transforms move the glyph.

Returns

UnityEngine.Vector3

public readonly Color sourceColor

Immutable center sample of the glyph’s original four-corner source color.

Returns

UnityEngine.Color

public readonly bool hasSourceColor

Whether the active renderer supplied an original source-color sample.

Returns

System.Boolean

public readonly Vector3 spatialPosition

Glyph center after the active Text Studio placement.

Returns

UnityEngine.Vector3

public readonly Vector3 worldPosition

Placed glyph center transformed into world space by the owning hub.

Returns

UnityEngine.Vector3

public readonly bool hasInfluenceTarget

Whether the owning hub currently supplies a shared spatial effect target.

Returns

System.Boolean

public readonly Vector3 influenceTargetLocalPosition

Shared effect target transformed into the owning hub’s local text space.

Returns

UnityEngine.Vector3

public readonly Vector3 influenceTargetWorldPosition

Shared effect target in world space.

Returns

UnityEngine.Vector3

EffectEvaluationContext(int, int, int, int, AnimationPhase, float, float, float, float)

Section titled “EffectEvaluationContext(int, int, int, int, AnimationPhase, float, float, float, float)”
public EffectEvaluationContext(int glyphIndex, int totalGlyphs, int wordIndex, int lineIndex, AnimationPhase phase, float phaseProgress, float time, float deltaTime, float normalizedIndex)

Creates evaluation context without extended source-unit metadata.

Parameters

Name Type
glyphIndex System.Int32
totalGlyphs System.Int32
wordIndex System.Int32
lineIndex System.Int32
phase TextStudio.AnimationPhase
phaseProgress System.Single
time System.Single
deltaTime System.Single
normalizedIndex System.Single

EffectEvaluationContext(int, int, int, int, AnimationPhase, float, float, float, float, in TextStudioEffectUnitContext)

Section titled “EffectEvaluationContext(int, int, int, int, AnimationPhase, float, float, float, float, in TextStudioEffectUnitContext)”
public EffectEvaluationContext(int glyphIndex, int totalGlyphs, int wordIndex, int lineIndex, AnimationPhase phase, float phaseProgress, float time, float deltaTime, float normalizedIndex, in TextStudioEffectUnitContext unit)

Creates evaluation context with renderer-neutral source-unit metadata.

Parameters

Name Type
glyphIndex System.Int32
totalGlyphs System.Int32
wordIndex System.Int32
lineIndex System.Int32
phase TextStudio.AnimationPhase
phaseProgress System.Single
time System.Single
deltaTime System.Single
normalizedIndex System.Single
unit TextStudio.TextStudioEffectUnitContext

EffectEvaluationContext(int, int, int, int, AnimationPhase, float, float, float, float, float, in TextStudioEffectUnitContext)

Section titled “EffectEvaluationContext(int, int, int, int, AnimationPhase, float, float, float, float, float, in TextStudioEffectUnitContext)”
public EffectEvaluationContext(int glyphIndex, int totalGlyphs, int wordIndex, int lineIndex, AnimationPhase phase, float phaseProgress, float time, float playbackTime, float deltaTime, float normalizedIndex, in TextStudioEffectUnitContext unit)

Creates complete evaluation context including source-text normalized position.

Parameters

Name Type
glyphIndex System.Int32
totalGlyphs System.Int32
wordIndex System.Int32
lineIndex System.Int32
phase TextStudio.AnimationPhase
phaseProgress System.Single
time System.Single
playbackTime System.Single
deltaTime System.Single
normalizedIndex System.Single
unit TextStudio.TextStudioEffectUnitContext