Table of Contents

Struct SegmentData

To be used with TMPAnimator and its animations.
Contains data about a given animation segment.
Only does some basic info parsing. For more specialised information, e.g. word-count, you can manually derive the info from CharInfo.

public readonly struct SegmentData : ITMPSegmentData
Implements
Inherited Members

Constructors

SegmentData(TMPEffectTagIndices, IList<CharData>, Predicate<char>)

public SegmentData(TMPEffectTagIndices indices, IList<CharData> cData, Predicate<char> animates)

Parameters

indices TMPEffectTagIndices
cData IList<CharData>
animates Predicate<char>

Fields

effectiveLength

The effective length of the animation segment; i.e. the length of the segment from firstAnimationIndex to lastAnimationIndex.

public readonly int effectiveLength

Field Value

int

firstAnimationIndex

The index of the first character that is relevant to the TMPAnimator and will be animated.

public readonly int firstAnimationIndex

Field Value

int

firstVisibleIndex

The index of the first visible character (i.e. non-whitespace character).

public readonly int firstVisibleIndex

Field Value

int

lastAnimationIndex

The index of the last character that is relevant to the TMPAnimator and will be animated.

public readonly int lastAnimationIndex

Field Value

int

lastVisibleIndex

The index of the last visible character (i.e. non-whitespace character).

public readonly int lastVisibleIndex

Field Value

int

Properties

CharInfo

The CharData.Info of each character in the segment.

public IEnumerable<CharData.Info> CharInfo { get; }

Property Value

IEnumerable<CharData.Info>

EndIndex

The last index of the segment within the containing text.

public int EndIndex { get; }

Property Value

int

Length

The length of the animation segment.

public int Length { get; }

Property Value

int

StartIndex

The first index of the segment within the containing text.

public int StartIndex { get; }

Property Value

int

Methods

GetCharInfo(int)

Get a specific CharData.Info from a segment index.

public CharData.Info GetCharInfo(int segmentIndex)

Parameters

segmentIndex int

Returns

CharData.Info

The CharData.Info associated with the segment index.

IndexToSegmentIndex(int)

Convert a text index to the index within the segment.

public int IndexToSegmentIndex(int index)

Parameters

index int

The text index to convert.

Returns

int

The segment index.

SegmentIndexOf(CharData)

Get the segment index of the given CharData.

public int SegmentIndexOf(CharData cData)

Parameters

cData CharData

Returns

int