format
typescript
AudioSource.maxDistanceclass: AudioSource
description
The maximum distance at which the audio source can be heard.
The maximum distance refers to the distance at which the sound will no longer be audible. When the distance between the listener and the audio source exceeds the maximum distance, the sound will no longer be heard, thus defining the audible range of the audio.
parameter
| param_name | type | description |
|---|
reture
| type | description |
|---|---|
number | The maximum distance for audio propagation. |
code example
typescript
let obj = new GameObject();
let source = obj.AddComponent<AudioSource>(AudioSource);
source.maxDistance;