Struct SegmentData
- Namespace
- TMPEffects.Components.Animator
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
TMPEffectTagIndicescData
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
firstAnimationIndex
The index of the first character that is relevant to the TMPAnimator and will be animated.
public readonly int firstAnimationIndex
Field Value
firstVisibleIndex
The index of the first visible character (i.e. non-whitespace character).
public readonly int firstVisibleIndex
Field Value
lastAnimationIndex
The index of the last character that is relevant to the TMPAnimator and will be animated.
public readonly int lastAnimationIndex
Field Value
lastVisibleIndex
The index of the last visible character (i.e. non-whitespace character).
public readonly int lastVisibleIndex
Field Value
Properties
CharInfo
The CharData.Info of each character in the segment.
public IEnumerable<CharData.Info> CharInfo { get; }
Property Value
EndIndex
The last index of the segment within the containing text.
public int EndIndex { get; }
Property Value
Length
The length of the animation segment.
public int Length { get; }
Property Value
StartIndex
The first index of the segment within the containing text.
public int StartIndex { get; }
Property Value
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
intThe 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