private AudioClip GetAudioClip(string audioName) { audioName = System.IO.Path.Combine(audioPath, audioName); var audio = AssetsLoader.GetAudioClip(audioName); Assert.IsNotNull(audio); return(audio); }
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)); } }
/// <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); }
/// <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; }
/// <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); }
private AudioClip GetAudioClip(string audioName) { audioName = audioPath + audioName; return(AssetsLoader.GetAudioClip(audioName)); }