- New occlusion opt-in on SoundEffect: spatialized instances get a SteamAudioSource with raycast occlusion + frequency-dependent transmission (walls muffle instead of hard-mute) - Replace SoundEffectDistanceRange asset indirection with an explicit _3d bool (user refactor); rolloff/distance now left to defaults - Hey.asset: occlusion enabled Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
35 lines
887 B
C#
35 lines
887 B
C#
using UnityEngine.Audio;
|
|
|
|
namespace Prototype
|
|
{
|
|
public struct SoundEffectOptions
|
|
{
|
|
public AudioMixerGroup audioMixerGroup;
|
|
|
|
public float? volume;
|
|
public float? volumeMultiplier;
|
|
public float GetVolume() => (volume ?? 1) * (volumeMultiplier ?? 1);
|
|
|
|
public float? pitch;
|
|
public float GetPitch() => pitch ?? 1;
|
|
|
|
public bool? loop;
|
|
public bool GetLoop() => loop ?? false;
|
|
|
|
public bool? _3d;
|
|
public bool Get3D() => _3d ?? false;
|
|
|
|
public bool? destroyOnLoad;
|
|
public bool ShouldDestroyOnLoad() => destroyOnLoad ?? true;
|
|
|
|
public float? delay;
|
|
public float GetDelay() => delay ?? 0;
|
|
|
|
public bool? spatialize;
|
|
public bool GetSpatialize() => spatialize ?? false;
|
|
|
|
public bool? occlusion;
|
|
public bool GetOcclusion() => occlusion ?? false;
|
|
}
|
|
}
|