bool Force2d { get; set; }

book_4_sparkGenerated
code_blocksInput

Description

The Force2d property of the BaseSoundComponent class determines whether the sound should be forced to play in 2D mode, ignoring any 3D spatialization effects. When set to true, the sound will be played as if it is coming from a fixed position relative to the listener, without any positional audio effects.

Usage

To use the Force2d property, simply set it to true or false depending on whether you want the sound to be played in 2D mode or not. This can be useful for UI sounds or other audio that should not be affected by the 3D environment.

Example

// Example of setting the Force2d property
BaseSoundComponent soundComponent = new BaseSoundComponent();
soundComponent.Force2d = true; // Forces the sound to play in 2D mode

// To disable 2D mode and allow 3D spatialization
doundComponent.Force2d = false;