Add audioDistance to tornados (#178)

This commit is contained in:
Nick 2022-06-13 20:21:05 -04:00
parent 7a7dc7f57a
commit b0bc48465c
2 changed files with 8 additions and 2 deletions

View File

@ -116,8 +116,9 @@ namespace NewHorizons.Builder.Props
tornadoGO.transform.localScale = Vector3.one * scale;
// Resize the distance it can be heard from to match roughly with the size
audioSource.maxDistance = 10 * scale;
audioSource.minDistance = scale;
var maxDistance = info.audioDistance == 0 ? 10 * scale : info.audioDistance;
audioSource.maxDistance = maxDistance;
audioSource.minDistance = maxDistance / 10f;
var controller = tornadoGO.GetComponent<TornadoController>();
controller.SetSector(sector);

View File

@ -234,6 +234,11 @@ namespace NewHorizons.External.Modules
/// 0.1.
/// </summary>
public float wanderRate;
/// <summary>
/// The maximum distance at which you'll hear the sounds of the cyclone. If not set it will scale relative to the size of the cyclone.
/// </summary>
public float audioDistance;
}
[JsonObject]