IEnumerator LevelComplete() { yield return(new WaitForSeconds(0.3f)); gameObject.GetComponent <SpriteRenderer>().enabled = false; yield return(new WaitForSeconds(1.5f)); CanvasObject.OnLevelComplete(); CanvasObject.LevelCompletePanel.SetActive(true); }