Skip to content

BackgroundMusic

namespace Griff.Scenes;
public sealed class BackgroundMusic : Component

Music for the scene: it starts when the scene does, crossfading over Fade seconds from whatever was playing. If that’s the same music it just carries on, so every level can name the same tune and it never restarts. A Room’s music takes over while its room is entered.

This is a component: its saved properties are on its component page.

public float Fade { get; set; }

Seconds to crossfade from the music already playing; 0 cuts straight over.

public bool Loop { get; set; }

Starts over when it ends. Untick for a jingle that plays once.

public string? Music { get; set; }

The music to play, e.g. “Music/theme.wav”. Make one with Audio > New Music.

public float Volume { get; set; }

How loud, 0 to 1, on top of the player’s music volume.