Class AnimatorContext
- Namespace
- TMPEffects.Components.Animator
- Assembly
- TMPEffects.dll
To be used with TMPAnimator.
Contains context data of the respective TMPAnimator.
[Serializable]
public class AnimatorContext : IAnimatorContext
- Inheritance
-
AnimatorContext
- Implements
- Inherited Members
Constructors
AnimatorContext()
public AnimatorContext()
AnimatorContext(TMPAnimator)
public AnimatorContext(TMPAnimator animator)
Parameters
animator
TMPAnimator
AnimatorContext(TMPAnimator, bool, bool, bool, Func<int, float>, Func<int, float>)
public AnimatorContext(TMPAnimator animator, bool scaleAnimations, bool useScaledTime, bool scaleUniformly, Func<int, float> getVisibleTime, Func<int, float> getStateTime)
Parameters
animator
TMPAnimatorscaleAnimations
booluseScaledTime
boolscaleUniformly
boolgetVisibleTime
Func<int, float>getStateTime
Func<int, float>
Fields
_StateTime
[NonSerialized]
[HideInInspector]
public Func<int, float> _StateTime
Field Value
_VisibleTime
[NonSerialized]
[HideInInspector]
public Func<int, float> _VisibleTime
Field Value
deltaTime
[NonSerialized]
[HideInInspector]
public float deltaTime
Field Value
passed
[NonSerialized]
[HideInInspector]
public float passed
Field Value
Properties
Animator
The animating TMPAnimator.
public TMPAnimator Animator { get; set; }
Property Value
DeltaTime
The current delta time (=> time since last animation update).
public float DeltaTime { get; set; }
Property Value
PassedTime
The time that has passed since the animator began animating.
public float PassedTime { get; set; }
Property Value
ScaleAnimations
Whether animations are scaled.
public bool ScaleAnimations { get; set; }
Property Value
ScaleUniformly
Whether to scale animations uniformly (based on the default font size of the animator)
or on a per character basis.
Ignored if ScaleAnimations is false.
public bool ScaleUniformly { get; set; }
Property Value
UseScaledTime
Whether animations use scaled time.
public bool UseScaledTime { get; set; }
Property Value
Methods
StateTime(int)
Check how long the CharData at the given index has been in its current VisibilityState.
Generally, to be used with show and hide animations.
public float StateTime(int index)
Parameters
index
intThe index of the character to check.
Returns
- float
How long the CharData at the given index has been in its current VisibilityState.
StateTime(CharData)
Check how long the passed CharData has been in its current VisibilityState.
Generally, to be used with show and hide animations.
public float StateTime(CharData cData)
Parameters
cData
CharDataThe character to check.
Returns
- float
How long the passed CharData has been in its current VisibilityState.
VisibleTime(int)
Check how long the CharData at the given index has been visible.
public float VisibleTime(int index)
Parameters
index
int
Returns
VisibleTime(CharData)
Check how long the passed CharData has been visible.
public float VisibleTime(CharData cData)
Parameters
cData
CharDataThe character to check.