Radar ping taunt sound + per-SoundEffect spatialize opt-in
MatchManager: new Radar Ping Sound property; MsgRadarPing now goes to all clients (spawnBlips flag keeps blips hunter-only), sound plays 3D at each pinged hider. Distance-based stagger (speed of sound + 35 ms min gap) prevents phase cancellation when multiple hiders ping. SoundEffect: new spatialize toggle (per asset, applied only to 3D instances -> Steam Audio HRTF); removed unused fade field. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
a36f398b94
commit
0172a1e834
4 files changed
+99
-35
No files matched your search
@@ -15,8 +15,7 @@ namespace Prototype
|
||||
public AudioMixerGroup audioMixerGroup;
|
||||
public float volumeMultiplierFactor = 1;
|
||||
[SerializeField] bool loop;
|
||||
[SerializeField] Vector2 fade = new();
|
||||
|
||||
[SerializeField] bool spatialize;
|
||||
|
||||
[Header("Additional Settings")]
|
||||
[SerializeField, Range(0, 1)] float defaultVolume = .8f;
|
||||
@@ -36,8 +35,8 @@ namespace Prototype
|
||||
volumeMultiplier = Random.Range(volumeMultiplier.x, volumeMultiplier.y) * volumeMultiplierFactor,
|
||||
pitch = Random.Range(pitch.x, pitch.y),
|
||||
loop = loop,
|
||||
distanceRange = distanceRange ? distanceRange.range : null,
|
||||
fade = fade
|
||||
spatialize = spatialize,
|
||||
distanceRange = distanceRange ? distanceRange.range : null
|
||||
};
|
||||
|
||||
#if UNITY_EDITOR
|
||||
|
||||
@@ -26,6 +26,7 @@ namespace Prototype
|
||||
var range = options.GetDistanceRange();
|
||||
|
||||
audioSource.spatialBlend = range.x == 0 && range.y == 0 ? 0 : 1;
|
||||
audioSource.spatialize = options.GetSpatialize() && audioSource.spatialBlend > 0;
|
||||
audioSource.rolloffMode = AudioRolloffMode.Linear;
|
||||
audioSource.minDistance = range.x;
|
||||
audioSource.maxDistance = range.y;
|
||||
|
||||
@@ -20,13 +20,13 @@ namespace Prototype
|
||||
public Vector2? distanceRange;
|
||||
public Vector2 GetDistanceRange() => distanceRange ?? new(30, 200);
|
||||
|
||||
public Vector2? fade;
|
||||
public Vector2 GetFade() => fade ?? new();
|
||||
|
||||
public bool? destroyOnLoad;
|
||||
public bool ShouldDestroyOnLoad() => destroyOnLoad ?? true;
|
||||
|
||||
public float? delay;
|
||||
public float GetDelay() => delay ?? 0;
|
||||
|
||||
public bool? spatialize;
|
||||
public bool GetSpatialize() => spatialize ?? false;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user