protected virtual void Start() { JCS_SoundManager sm = JCS_SoundManager.instance; sm.SetAudioListener(GetAudioListener()); // add it to Sound Manager so it could manage // the volume and mute! sm.AssignSoundSource(JCS_SoundSettingType.SKILLS_SOUND, mSoundPlayer.GetAudioSource()); }
/// <summary> /// Play the tick sound. /// </summary> /// <param name="clip"></param> private void PlayTimerSound(AudioClip clip) { if (clip == null) { return; } JCS_SoundManager sm = JCS_SoundManager.instance; sm.GetGlobalSoundPlayer().PlayOneShot(clip); }
private void Awake() { instance = this; // try to get component, this is not guarantee. this.mJCSFadeSound = this.GetComponent <JCS_FadeSound>(); mSFXSounds = new JCS_Vector <AudioSource>(); mSkillsSounds = new JCS_Vector <AudioSource>(); mGlobalSoundPlayer = this.GetComponent <JCS_SoundPlayer>(); }
/// <summary> /// Get the real sound fade in time base on /// the sound manager override setting? /// </summary> /// <returns> time to fade in the sound </returns> public float GetSoundFadeInTimeBaseOnSetting() { JCS_SoundManager jcsSm = JCS_SoundManager.instance; // check if override the setting. if (jcsSm.OverrideSetting) { // return the override value. return(jcsSm.SoundFadeInTime); } // if not override, // return the basic value. return(SOUND_FADEIN_TIME); }