Class ToggleTweenAnimator
- Namespace
- Fallencake.UI
- Assembly
- Fallencake.UI.dll
Animator that plays separate tween sets for ON and OFF states and provides helpers to invert and stop.
public class ToggleTweenAnimator : MonoBehaviour, ITweenAnimator
- Inheritance
-
objectObjectComponentBehaviourMonoBehaviourToggleTweenAnimator
- Implements
Fields
OffTweenCompleted
Event that is triggered when all OffTweens have completed their animation.
public UnityEvent OffTweenCompleted
Field Value
- UnityEvent
OffTweenStarted
Event that is triggered when the first tween in OffTweens starts playing.
public UnityEvent OffTweenStarted
Field Value
- UnityEvent
OnTweenCompleted
Event that is triggered when all OnTweens have completed their animation.
public UnityEvent OnTweenCompleted
Field Value
- UnityEvent
OnTweenStarted
Event that is triggered when the first tween in OnTweens starts playing.
public UnityEvent OnTweenStarted
Field Value
- UnityEvent
Properties
OffTweens
Exposes OFF tweens list for configuration or runtime adjustments.
public List<ITween> OffTweens { get; }
Property Value
- List<ITween>
OnTweens
Exposes ON tweens list for configuration or runtime adjustments.
public List<ITween> OnTweens { get; }
Property Value
- List<ITween>
Tweens
Returns the primary tweens list for generic interface access. For this animator it exposes the ON tweens by default.
public List<ITween> Tweens { get; set; }
Property Value
- List<ITween>
Methods
InvertStates()
public void InvertStates()
Play(Action)
Plays the default state tweens (ON state) for generic interface support.
public void Play(Action onComplete)
Parameters
onCompleteActionCallback invoked after the tweens complete.
PlayOffState(Action)
Plays the OFF state tweens in OffTweens.
public void PlayOffState(Action onComplete = null)
Parameters
onCompleteActionOptional callback executed when all OFF tweens complete.
PlayOnState(Action)
Plays the ON state tweens in OnTweens.
public void PlayOnState(Action onComplete = null)
Parameters
onCompleteActionOptional callback executed when all ON tweens complete.
PlayState(bool)
public void PlayState(bool isOn)
Parameters
isOnboolIf true, plays ON state tweens; otherwise plays OFF state tweens.
SetStateInstant(bool)
Instantly applies the end values of OnTweens or OffTweens without animation. Stops any running animations and sets all targets to their final state immediately.
public void SetStateInstant(bool isOn)
Parameters
isOnboolIf true, applies ON state end values; otherwise applies OFF state end values.
Stop()
public void Stop()