public bool PlayWeatherMusic(string audioName, float fadeInTime) { string eventName = string.Empty; string switchGroup = string.Empty; string switchState = string.Empty; if (CUnityUtil.IsWwiseAudioName(audioName)) { CUnityUtil.GetWwiseAudioName(audioName, out eventName, out switchGroup, out switchState); } else { return(false); } #if false //LOG_WWISE && UNITY_EDITOR Common.HobaDebuger.LogWarningFormat("[UnityAudio] Playing [Wwise] Event: {0} SwitchGroup: {1} SwitchState: {2}", eventName, switchGroup, switchState); #endif if (_WeatherSoundEntry.IsEnabled) { CheckAudioListener(); SafeInitGameObject(_WeatherSoundEntry, "weather"); LoadAndPlayMusic(_WeatherSoundEntry, eventName, switchGroup, switchState); } return(true); }
public string Play2DAudio(string audioName, int sortId = 0, bool isLoop = false) { if (CUnityUtil.IsWwiseAudioName(audioName)) { return(string.Empty); } EffectAudioSourceItem item = _PlaySFX(audioName, AudioType.S2D, null, Vector3.zero, sortId, isLoop); return(item != null && item.audioSource != null ? item.audioSource.name : string.Empty); }
public bool PlayWeatherMusic(string envName, float fadeInTime) { if (CUnityUtil.IsWwiseAudioName(envName)) { return(false); } if (_WeatherSoundEntry.IsEnabled) { CheckAudioListener(); SafeInitGameObject(_WeatherSoundEntry, "weather"); LoadAndPlayMusic(_WeatherSoundEntry, envName, fadeInTime); } return(true); }
public bool PlayBackgroundMusic(string bgmName, float fadeInTime) { if (CUnityUtil.IsWwiseAudioName(bgmName)) { return(false); } if (_BgmSoundEntry.IsEnabled) { CheckAudioListener(); SafeInitGameObject(_BgmSoundEntry, "background"); LoadAndPlayMusic(_BgmSoundEntry, bgmName, fadeInTime); } return(true); }