public void Stop(float fadeOutSeconds = 0.0f, bool destroyOnStopped = false) { if (AudioSourceLoop != null && AudioSourceLoop.AudioSource != null) { #if ENABLE_DEBUG_LOG_WEATHER_MAKER_SOUNDS Debug.LogFormat("Weather Maker stopping sound {0}", Name); #endif AudioSourceLoop.Stop(fadeOutSeconds, destroyOnStopped); timeToNextPlay = 0.0f; } }
public void Stop() { #if UNITY_EDITOR if (!Application.isPlaying) { return; } #endif if (AudioSourceLoop != null && AudioSourceLoop.AudioSource != null && AudioSourceLoop.AudioSource.isPlaying && !AudioSourceLoop.Stopping) { #if ENABLE_DEBUG_LOG_WEATHER_MAKER_SOUNDS Debug.LogFormat("Weather Maker stopping sound {0}", Name); #endif AudioSourceLoop.Stop(); timeToNextPlay = 0.0f; } }