예제 #1
0
        protected override void OnInitialize(IGameContext context)
        {
            InitialState  = new ReadingGameInitialState(this);
            QuestionState = new ReadingGameQuestionState(this);
            ReadState     = new ReadingGameReadState(this);
            AnswerState   = new ReadingGameAnswerState(this);

            if (ReadingGameConfiguration.Instance.Variation != ReadingGameVariation.ReadAndAnswer)
            {
                ISongParser parser = new AkrSongParser();

                var textAsset = ReadingGameConfiguration.Instance.Variation == ReadingGameVariation.Alphabet ? alphabetSongSrt : diacriticSongSrt;

                using (MemoryStream stream = new MemoryStream(Encoding.UTF8.GetBytes(textAsset.text)))
                {
                    songToPlay = new KaraokeSong(parser.Parse(stream));
                }
            }

            radialWidget.Hide();

            // Instantiating a runtime material
            magnifyingGlassMaterial      = new Material(magnifyingGlassMaterial);
            magnifyingGlassMaterial.name = magnifyingGlassMaterial.name + "(INSTANCE)";
            blurredTextMaterial          = new Material(blurredTextMaterial);
            blurredTextMaterial.name     = blurredTextMaterial.name + "(INSTANCE)";
        }
예제 #2
0
        protected override void OnInitialize(IGameContext context)
        {
            InitialState  = new ReadingGameInitialState(this);
            QuestionState = new ReadingGameQuestionState(this);
            ReadState     = new ReadingGameReadState(this);
            AnswerState   = new ReadingGameAnswerState(this);

            if (ReadingGameConfiguration.Instance.CurrentGameType == ReadingGameConfiguration.GameType.FollowSong)
            {
                ISongParser parser = new AkrSongParser();

                var textAsset = ReadingGameConfiguration.Instance.Variation == ReadingGameVariation.SongAlphabet ? alphabetSongSrt : diacriticSongSrt;

                using (MemoryStream stream = new MemoryStream(Encoding.UTF8.GetBytes(textAsset.text)))
                {
                    songToPlay = new KaraokeSong(parser.Parse(stream));
                }
            }

            radialWidget.Hide();

            // Instantiating a runtime material
            magnifyingGlassMaterial      = new Material(magnifyingGlassMaterial);
            magnifyingGlassMaterial.name = magnifyingGlassMaterial.name + "(INSTANCE)";
            blurredTextMaterial          = new Material(blurredTextMaterial);
            blurredTextMaterial.name     = blurredTextMaterial.name + "(INSTANCE)";

            runLettersBox.Initialize(letterObjectPrefab, shadowPrefab);
            gameLettersHandler.Initialize(letterObjectPrefab, shadowPrefab);

            DisableRepeatPromptButton();

            antura.gameObject.SetActive(ReadingGameConfiguration.Instance.CurrentGameType != ReadingGameConfiguration.GameType.SimonSong);
            dancingAntura.gameObject.SetActive(ReadingGameConfiguration.Instance.CurrentGameType == ReadingGameConfiguration.GameType.SimonSong);
            dancingAntura.State = AnturaAnimationStates.dancing;
        }