public IEnumerator CountDown() { if (isGameOver) { PlayerPrefs.SetInt("GameAdsCount", PlayerPrefs.GetInt("GameAdsCount")); EndGameUI.SetActive(false); CountDownUI.SetActive(true); for (i = 3; i > 0; i--) { CountDownText.text = i.ToString(); CountDownText.gameObject.transform.localScale = Vector3.one; CountDownText.gameObject.transform.DOScale(Vector3.zero, 1f).SetEase(Ease.Linear); yield return(new WaitForSeconds(1f)); } if (i == 0) { ResumeGame(); } } else { yield return(null); } }
public void ResumeGame() { InGameUI.SetActive(true); CountDownUI.SetActive(false); SpaceShipController.instance.ResumeGame(); }