private IEnumerator TypeText() { _IsPlaying = true; text.text = ""; foreach (char letter in word.ToCharArray()) { if (_IsPlaying) { text.text += letter; yield return(new WaitForSeconds(letterPause)); } } _IsPlaying = false; onAnimationEnd?.Invoke(); }
/// <summary> /// Updates the animation. Not the part of entity loop, /// you need to call it on your own. /// /// NOTE: If using in Draw method, keep in mind that each camera calls the event separately. /// You may want to restrict it only to the first camera. /// </summary> public void Update() { if (!Running) { return; } LinearProgress += TimeKeeper.Time(Math.Abs(Speed)); if (LinearProgress > 1) { if (!Looping) { Running = false; LinearProgress = 1; } else { LinearProgress -= (int)LinearProgress; } AnimationEndEvent?.Invoke(this); } }
public void StartMoveEndEvent() { AnimationEndEvent?.Invoke(); }
// OnStateEnter is called before OnStateEnter is called on any state inside this state machine //override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { // //} // OnStateUpdate is called before OnStateUpdate is called on any state inside this state machine //override public void OnStateUpdate(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { // //} // OnStateExit is called before OnStateExit is called on any state inside this state machine override public void OnStateExit(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { stateEndEvent.Invoke(stateInfo); }