Exemple #1
0
        public override void OnNewLaserbeam(Laserbeam laserbeams)
        {
            Player  player   = base.Scene.Tracker.GetEntity <Player>();
            Vector2 position = player != null && atPlayer ? player.Position : Position;

            float pitch = NoteHelper.relativeA4ToFreq(this.pitch - 69) / 440f;

            FMOD.Studio.EventInstance instance = Audio.Play(SFX.EventnameByHandle(sound), position);

            instance?.setVolume(volume);
            instance?.setPitch(pitch);
        }