格式
typescript
AudioSource.rolloffCurve所属类: AudioSource
描述
音频源的音量衰减曲线。
当rolloffMode为Custom时,指定音量衰减曲线,设置该值会使minDistance和maxDistance的设置失效。其中每个Vector2的x为距离,y为音量大小(0到1之间)。
参数
| 参数名 | 类型 | 描述 |
|---|
返回值
| 类型 | 描述 |
|---|---|
Vector2[] | 音量衰减曲线。 |
代码示例
typescript
let obj = new GameObject();
let source = obj.AddComponent<AudioSource>(AudioSource);
source.rolloffCurve;