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)"; }
public void SetData(ILivingLetterData data) { maxBarSize = MAX_BAR_SIZE; string text = data.TextForLivingLetter; var splitText = text.Split(' '); for (int i = 0; i < splitText.Length - 1; ++i) { splitText[i] = splitText[i] + " "; } currentBarWords = SetData(splitText, null, true); currentBarSong = null; //SetActiveBar(bars[0]); }
public void SetData(KaraokeSong data) { maxBarSize = MAX_BAR_SIZE_SONG; var karaokeLines = data.lines; string[] words = new string[karaokeLines.Count]; bool[] lineBreaks = new bool[karaokeLines.Count]; for (int i = 0; i < karaokeLines.Count; ++i) { words[i] = karaokeLines[i].text; lineBreaks[i] = karaokeLines[i].starsWithLineBreak; } currentBarWords = SetData(words, lineBreaks, false); currentBarSong = data; for (int i = 0; i < bars.Count; ++i) { bars[i].currentTarget = 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; }