public void NextSentence() { dialogueText.text = ""; if (bossIndex == index - 1) { characterNameDialogue.text = bossName; bossAvatar.gameObject.SetActive(true); mainAvatar.gameObject.SetActive(false); Type(bossSentences[bossIndex]); bossIndex++; } else if (index < characterSentences.Length) { characterNameDialogue.text = characterName; mainAvatar.gameObject.SetActive(true); bossAvatar.gameObject.SetActive(false); Type(characterSentences[index]); index++; } else { dialogueText.text = ""; continueButton.gameObject.SetActive(false); sceneManager.ChangeSceneToGamePlay(); } }