The Volume
property of the SoundEvent
class specifies how loud the sound should be. It is represented as a RangedFloat
, allowing for precise control over the sound's volume within a specified range.
The Volume
property of the SoundEvent
class specifies how loud the sound should be. It is represented as a RangedFloat
, allowing for precise control over the sound's volume within a specified range.
The Volume
property can be adjusted to control the loudness of the sound associated with a SoundEvent
. The value is a float ranging from 0 to 1, where 0 represents silence and 1 represents the maximum volume. The property is decorated with a RangeAttribute
to enforce this range, ensuring that the volume is always within the valid limits.
// Create a new SoundEvent instance SoundEvent soundEvent = new SoundEvent(); // Set the volume to 50% soundEvent.Volume = 0.5f; // Play the sound event soundEvent.Play();