public void NextBox() { // if we finished the list of messages, close the tutorial box with an animation if (currentMessageIndex >= messages.Length) { tutorialBox.TriggerClosingAnimation(); Debug.Log("End of tutorial boxes reached."); return; } if (currentMessageIndex == messages.Length - 1) { tutorialBox.ShowDots(false); } // display current message tutorialBox.SetText(messages[currentMessageIndex]); // set next message index currentMessageIndex++; }