format
typescript
AudioSource.rolloffCurveclass: AudioSource
description
The volume attenuation curve of the audio source.
When the rolloffMode is set to Custom, this specifies the volume attenuation curve. Setting this value will override the settings of minDistance and maxDistance. Each Vector2 in the curve represents a distance and a volume level (between 0 and 1).
parameter
| param_name | type | description |
|---|
reture
| type | description |
|---|---|
Vector2[] | The volume attenuation curve. |
code example
typescript
let obj = new GameObject();
let source = obj.AddComponent<AudioSource>(AudioSource);
source.rolloffCurve;