/// <summary> /// Runs the sound effect /// </summary> /// <param name="objects">List of objects in the game</param> /// <param name="player">Player</param> public override void RunTrigger(List<GameObject> objects, Player player) { if (player.IsCollidingCircleandCircle(this)&&!_playing) { _soundByte.Play(); _playing = true; } else if (!player.IsCollidingCircleandCircle(this)) _playing = false; }
public override void RunTrigger(List<GameObject> objects, Player player) { if (player.IsCollidingCircleandCircle(this) && _musicByteInstance.State != SoundState.Playing) { GameSound.StopOthersAndPlay(_musicByteInstance); GameSound.SetGeneric(_musicByteInstance); } }