public SoundPlayer(AudioSource audioSource, ICoroutineControl coroutineControl, SoundManagerDebugLogger log) { _log = log; _audioSource = audioSource; _coroutines = coroutineControl; // Cache _audioTransform = _audioSource.transform; }
private void SetupLogging() { switch (_loggingType) { case LoggingType.None: break; case LoggingType.LogOnlyInEditor: if (Application.isEditor) { _log = new SoundManagerDebugLogger(); } break; case LoggingType.LogAlways: _log = new SoundManagerDebugLogger(); break; default: Debug.LogException( new InvalidOperationException($"Unknown logging type '{_loggingType}' encountered. Cannot set up logging behavior.")); break; } }