Description
The Sounds
property of the Surface
class provides access to the sound data associated with a specific surface material. This property is used to define the audio characteristics that are triggered when interactions occur with the surface, such as footsteps, impacts, or other sound effects.
Usage
To use the Sounds
property, you can access it directly from an instance of the Surface
class. This property is not static, so it requires an instance of Surface
to be accessed. The Sounds
property returns a SoundData
object, which contains the specific sound configurations for the surface.
Example
// Example of accessing the Sounds property
// Assume 'surface' is an instance of Sandbox.Surface
Sandbox.Surface surface = new Sandbox.Surface();
// Access the Sounds property
Sandbox.Surface.SoundData soundData = surface.Sounds;
// Use the soundData to configure or retrieve sound settings
// For example, you might want to log or modify sound settings
// soundData.FootstepSound = "new_footstep_sound";