private void InitLetter() { m_LetterObjectView = m_CurrentLetter.GetComponent <LivingLetterController>(); if (ColorTickleConfiguration.Instance.Variation == ColorTickleVariation.Image) { m_LetterObjectView.TransformIntoImage(); m_LetterObjectView.LabelRender.color = Color.white; } m_TMPTextColoringLetter = m_CurrentLetter.GetComponent <TMPTextColoring>(); m_SurfaceColoringLetter = m_CurrentLetter.GetComponent <SurfaceColoring>(); m_LLController = m_CurrentLetter.GetComponent <ColorTickle_LLController>(); m_LLController.movingToDestination = true; m_HitStateLLController = m_CurrentLetter.GetComponent <HitStateLLController>(); m_HitStateLLController.OnTouchedOutside += OnTickled; m_LLController.OnDestinationReached += delegate() { game.Context.GetAudioManager().PlayVocabularyData( m_LetterObjectView.Data, soundType: ColorTickleConfiguration.Instance.GetVocabularySoundType() ); };//play audio on destination m_HitStateLLController.OnTouchedShape += TryEnableAntura; //game.anturaController.targetToLook = m_CurrentLetter.transform; //make antura look at the LL on rotations SetBrushColor(m_ColorsUIManager.defaultColor); ResetLaunchTimer(true); }
private void InitTutorialLetter() { m_LetterObjectView = m_TutorialLetter.GetComponent <LivingLetterController>(); m_TMPTextColoringLetter = m_TutorialLetter.GetComponent <TMPTextColoring>(); m_SurfaceColoringLetter = m_TutorialLetter.GetComponent <SurfaceColoring>(); m_LLController = m_TutorialLetter.GetComponent <ColorTickle_LLController>(); m_LLController.movingToDestination = true; m_HitStateLLController = m_TutorialLetter.GetComponent <HitStateLLController>(); m_HitStateLLController.OnTouchedOutside += LoseLife; m_HitStateLLController.EnableTutorial += EnableTutorialAnimation; SetBrushColor(new Color(255, 0, 0, 255)); DisableLetterComponents(); //m_LLController.OnDestinationReached += EnableTutorialAnimation; m_LLController.OnDestinationReached += delegate() { //play intro dialogue game.PlayIntro(() => { //play tutorial dialogue on intro finish //for now this is broken, COLORTICKLE_TUTO is repeated like a loop // HACK stop audio and replay music //game.Context.GetAudioManager().PlayDialogue(Db.LocalizationDataId.ColorTickle_Tuto, delegate() { game.Context.GetAudioManager().StopMusic(); game.Context.GetAudioManager().PlayMusic(game.backgroundMusic); }); game.PlayTutorial(null); EnableLetterComponents(); EnableTutorialAnimation(); }); }; }