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)); }
public static void SetCentrePointProvider(ICentrePointProvider centrePointProvider) { CentrePointProvider = 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); }
public void PlayForObjectWithCallback(GameSound gameSound, [NotNull] IGameObject gameObject, [NotNull] ICentrePointProvider centrePointProvider, [NotNull] EventHandler callback) { if (gameObject == null) { throw new ArgumentNullException(nameof(gameObject)); } if (centrePointProvider == null) { throw new ArgumentNullException(nameof(centrePointProvider)); } if (callback == null) { throw new ArgumentNullException(nameof(callback)); } InternalPlayForObject(gameSound, gameObject, centrePointProvider); AddCallback(gameSound, callback); }
public void PlayForObject(GameSound gameSound, [NotNull] IGameObject gameObject, [NotNull] ICentrePointProvider centrePointProvider) { if (gameObject == null) { throw new ArgumentNullException(nameof(gameObject)); } if (centrePointProvider == null) { throw new ArgumentNullException(nameof(centrePointProvider)); } InternalPlayForObject(gameSound, gameObject, centrePointProvider); }
public void PlayForObjectWithCallback(GameSound gameSound, IGameObject gameObject, ICentrePointProvider centrePointProvider, EventHandler callback) { // nothing to do }
public void PlayForObject(GameSound gameSound, IGameObject gameObject, ICentrePointProvider centrePointProvider) { // nothing to do }