public void addDialogue(string key, VoiceAudioOptions value)
 {
     if (!this.dialogueCues.ContainsKey(key))
     {
         this.dialogueCues.Add(key, value);
     }
 }
Exemplo n.º 2
0
        public static void addWavReference(string key, VoiceAudioOptions cue)
        {
            try
            {
                string translation = key.Split(Seperator).ElementAt(0);
                DictionaryReferences.TryGetValue(translation, out SortedDictionary <string, VoiceAudioOptions> value);

                value.Add(key, cue);
            }
            catch { }
        }
        /// <summary>Plays the associated dialogue file.</summary>
        /// <param name="dialogueString">The current dialogue string to play audio for.</param>
        public void speak(string dialogueString)
        {
            VoiceAudioOptions voiceFileName = new VoiceAudioOptions();
            bool exists = this.dialogueCues.TryGetValue(dialogueString, out voiceFileName);

            if (exists)
            {
                Vocalization.soundManager.stopAllSounds();
                Vocalization.soundManager.playSound(voiceFileName.getAudioClip());
            }
            else
            {
                Vocalization.ModMonitor.Log("The dialogue cue for the current dialogue could not be found. Please ensure that the dialogue is added the character's voice file and that the proper file for the voice exists.");
                return;
            }
        }