private void Update() { if (tutorialActive == false && tutorialSequence.Length > SaveController.Instance.GameData.BoterKroon.TutorialIndex) { TutorialFragment currentFragment = tutorialSequence[SaveController.Instance.GameData.BoterKroon.TutorialIndex]; if (currentFragment.AreRequirementsMet) { StartTutorial(currentFragment); } } }
private void StartTutorial(TutorialFragment currentFragment) { if (currentFragment is TutorialFragmentPointer) { StartPointerTutorial(currentFragment as TutorialFragmentPointer); } else if (currentFragment is TutorialFragmentText) { StartTextTutorial(currentFragment as TutorialFragmentText); } tutorialActive = true; }
private void RemoveTextTutorial() { textObject.GetComponentInChildren <Button>().onClick.RemoveListener(RemoveTextTutorial); TutorialFragment currentFragment = tutorialSequence[SaveController.Instance.GameData.BoterKroon.TutorialIndex]; if (currentFragment is ShowTutorialTextWithUIHighlight) { (currentFragment as ShowTutorialTextWithUIHighlight).HighlightUIElement.transform.SetParent(originalParent); (currentFragment as ShowTutorialTextWithUIHighlight).HighlightUIElement.transform.SetSiblingIndex(originalSiblingIndex); } canvasGroup.blocksRaycasts = false; canvasGroup.interactable = false; canvasGroup.DOFade(0, 0.3f).OnComplete(() => { Destroy(textObject); OnTutorialFinished(); }); }