// Start is called before the first frame update void Start() { // Creates tutorial instances foreach (TutorialDescriptor tutorialDescriptor in TutorialList) { int index = TutorialList.IndexOf(tutorialDescriptor); TutorialPanel tutorialPanel = Instantiate(TemplateTutorialPanel, this.transform); tutorialPanel.SetText(tutorialDescriptor.ExplanationText); tutorialPanel.SetPage(index + 1, TutorialList.Count); tutorialPages.Add(tutorialPanel); tutorialPanel.gameObject.SetActive(index == 0); // By default just the first page shall be active } if (tutorialPages.Count == 0) { TutorialButton.gameObject.SetActive(false); } }