public void StartWork() { if (ProgressManager.Instance.SavedStarsCount > 0) { SwipeAnimationCompleted?.Invoke(); Destroy(gameObject); } StartCoroutine(ShowFirstTutorial()); }
private IEnumerator ShowFirstTutorial() { transform.localPosition = new Vector3(xCoordinate.Evaluate(currentTime), transform.localPosition.y, transform.localPosition.z); sr.color = new Color(sr.color.r, sr.color.g, sr.color.b, alphaChannel.Evaluate(currentTime)); currentTime += Time.deltaTime * animationSpeed; if (switched) { SwipeAnimationCompleted?.Invoke(); Destroy(gameObject); } else { yield return(new WaitForEndOfFrame()); StartCoroutine(ShowFirstTutorial()); } }