// 각각의 대사 라인 처리 IEnumerator OnLine(Script.DialogueLine line) { Debug.Log(line.Tag); Debug.Log(line.Text); switch (line.Tag) { case syntax_background: episode.AddCommand(new VNBackground(VNDataContainer.Instance.GetDisplayable(line.Text))); yield break; break; case syntax_show: episode.AddCommand(new VNShow(VNDataContainer.Instance.GetDisplayable(line.Text))); yield break; break; case syntax_hide: episode.AddCommand(new VNHide(line.Text)); yield break; break; } episode.AddCommand(new VNSay(line.Tag, line.Text)); yield return(null); }
// 각각의 대사 라인 처리 IEnumerator OnLine(Script.DialogueLine line) { Debug.Log(line.Tag); Debug.Log(line.Text); episode.AddCommand(new VNSay(line.Tag, line.Text)); yield return(null); }
// 각각의 대사 라인 처리 IEnumerator OnLine(Script.DialogueLine line) { Debug.Log(line.Tag); Debug.Log(line.Text); if (line.Tag == syntax_background) { episode.AddCommand(new VNBackground(VNDataContainer.Instance.GetDisplayable(line.Text))); yield break; } episode.AddCommand(new VNSay(line.Tag, line.Text)); yield return(null); }
// 본격적인 파싱 부분. // 라인 by 라인으로 이터레이터의 MoveNext를 통해 읽어 나감 protected IEnumerator OnLine(Script.DialogueLine line) { AudioClip clip; // 공백 자르기 string[] words = Regex.Split(line.Text, "\\s+"); switch (line.Tag) { case syntax_background: new VNBackground(VNDataController.Instance.GetDisplayable(words[0], words[1])).Invoke(); break; case syntax_show: new VNShow(VNDataController.Instance.GetDisplayable(words[0], words[1])).Invoke(); break; case syntax_hide: new VNHide(line.Text).Invoke(); break; case syntax_voice: new VNVoice(line.Text).Invoke(); break; case syntax_musicPlay: clip = VNDataController.Instance.GetAudioClip(line.Text); new VNMusicPlay(clip).Invoke(); break; case syntax_audio: clip = VNDataController.Instance.GetAudioClip(line.Text); new VNAudio(clip).Invoke(); break; case syntax_loadScene: new VNLoadScene(line.Text).Invoke(); break; default: new VNSay(line.Tag, line.Text).Invoke(); break; } yield return(null); }
IEnumerator OnLine(Script.DialogueLine line) { // Change the display settings if (!string.IsNullOrEmpty(line.Tag)) { if (!CharacterDisplayInfos.TryGetValue(line.Tag, out cdi)) { // Ideally this should be part of validation (it will be at some point) throw new Exception("Unknown character tag!"); } } else { cdi = DEFAULT_CDI; } // Update the UI based on the current CharacterDisplayInfo Debug.Log(cdi.FullName); // Show the dialogue line textbox.text = line.Text; yield return(new WaitForSecondsRealtime(LineDelay)); }