public ActiveSoundForObject([NotNull] ISoundEffectInstance soundEffectInstance, [NotNull] IGameObject gameObject, [NotNull] ICentrePointProvider centrePointProvider) : base(soundEffectInstance) { if (gameObject == null) { throw new ArgumentNullException(nameof(gameObject)); } if (!gameObject.IsExtant) { throw new ArgumentException("GameObject is not extant."); } this._gameObject = gameObject; this._centrePointProvider = centrePointProvider ?? throw new ArgumentNullException(nameof(centrePointProvider)); }
private void InternalPlayForObject(GameSound gameSound, IGameObject gameObject, ICentrePointProvider centrePointProvider) { #if DEBUG if (!DoesSoundRequirePosition(gameSound)) { throw new ArgumentOutOfRangeException("GameSound " + gameSound + " should not be associated with a GameObject."); } #endif ISoundEffectInstance soundEffect = this.SoundLibrary[gameSound]; var activeSound = new ActiveSoundForObject(soundEffect, gameObject, centrePointProvider); this.ActiveSoundService.Add(activeSound); }
private void InternalPlay(GameSound gameSound) { #if DEBUG if (DoesSoundRequirePosition(gameSound)) { throw new ArgumentOutOfRangeException("GameSound " + gameSound + " needs to be associated with a GameObject."); } #endif ISoundEffectInstance soundEffect = this.SoundLibrary[gameSound]; var activeSound = new ActiveSound(soundEffect); this.ActiveSoundService.Add(activeSound); }
public ActiveSound([NotNull] ISoundEffectInstance soundEffectInstance) { this.SoundEffectInstance = soundEffectInstance ?? throw new ArgumentNullException(nameof(soundEffectInstance)); }