示例#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
        /// <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
 /// <summary>
 /// Change the background image
 /// This method is designed to be called by external scripts
 /// </summary>
 /// <param name="imageName">The name of the image file</param>
 public void SetImage(string imageName)
 {
     _spriteChanger.sprite = AssetsLoader.GetSprite(System.IO.Path.Combine(imageFolder, imageName));
     currentImageName      = imageName;
 }
示例#5
0
 /// <summary>
 /// Change the background image
 /// This method is designed to be called by external scripts
 /// </summary>
 /// <param name="imageName">The name of the image file</param>
 public void SetImage(string imageName)
 {
     _spriteRenderer.sprite = AssetsLoader.GetSprite(imageFolder + imageName);
 }
示例#6
0
 private AudioClip GetAudioClip(string audioName)
 {
     audioName = audioPath + audioName;
     return(AssetsLoader.GetAudioClip(audioName));
 }