IEnumerator EndGameAnimation() { Destroy(_candyMatrix.gameObject); Destroy(_timer.gameObject); yield return(new WaitForSeconds(.25f)); TweenPosition.Begin(_score.gameObject, _score.transform.localPosition, Vector3.zero, 1f); TweenScale.Begin(_score.gameObject, _score.transform.localScale, new Vector3(2f, 2f, 2f), 1f); while (TweenPosition.IsPlaying(_score.gameObject)) { yield return(null); } yield return(new WaitForSeconds(.25f)); _nextLevelButton.SetActive(true); }
public bool AnimationPlaying() { return(TweenPosition.IsPlaying(gameObject) || TweenScale.IsPlaying(gameObject)); }