public void NextSentence() { SoundManager.instance.PlaySFX(buttonSound); dialogueText.text = ""; sentenceHasFinished = false; if (index < sentences.Length - 1) { index++; StartCoroutine("Type"); } else { index = 0; dialogueCanvas.gameObject.SetActive(false); ScriptsAffectedByDialogue(true); foodSpawner.StartCoroutine("CoSpawnPlates"); } }