コード例 #1
0
        private AudioClip GetAudioClip(string audioName)
        {
            audioName = System.IO.Path.Combine(audioPath, audioName);
            var audio = AssetsLoader.GetAudioClip(audioName);

            Assert.IsNotNull(audio);
            return(audio);
        }
コード例 #2
0
 private void OnPlayVoiceButtonClicked(IEnumerable <string> audioNames)
 {
     // TODO this is an implementation for debug, the behaviour is not what we want
     foreach (var audioName in audioNames)
     {
         var clip = AssetsLoader.GetAudioClip(audioName);
         AudioSource.PlayClipAtPoint(clip, new Vector3(0, 0, -10));
     }
 }
コード例 #3
0
ファイル: CharacterController.cs プロジェクト: zhouhaoyu/Nova
        /// <summary>
        /// Make the character say something
        /// </summary>
        /// <remarks>
        /// Character will not say something immediately after this method is called. it will be marked as what to
        /// say something and speaks when the dialogue really changed
        /// </remarks>
        /// <param name="voiceFileName"></param>
        public void Say(string voiceFileName)
        {
            var audio = AssetsLoader.GetAudioClip(voiceFileFolder + voiceFileName);

            // A character has only one mouth
            if (audioSource.isPlaying)
            {
                audioSource.Stop();
            }

            willSaySomething = true;
            audioSource.clip = audio;
            gameState.AddVoiceClipOfNextDialogue(audio);
        }
コード例 #4
0
 private AudioClip GetAudioClip(string audioName)
 {
     audioName = audioPath + audioName;
     return(AssetsLoader.GetAudioClip(audioName));
 }