public class Sandbox.SoundscapeTrigger : Sandbox.Component
Plays a soundscape when the listener enters the trigger area.
Related Guides
Broader workflow and conceptual references connected to this API.
s&box provides several ways to play sounds in code. You can fire-and-forget a sound at a world position, control it via a SoundHandle, attach it to a GameObject, or use scene components entirely.
s&box has a full audio system including 2D/3D sound playback, voice chat, positional audio, an audio effects pipeline, and lip sync support.
Constructors
Showing 1 constructors
public SoundscapeTrigger()
No results match this filter.
Methods
Showing 5 methods
protected virtual void DrawGizmos()
protected virtual void OnDestroy()
protected virtual void OnDisabled()
protected virtual void OnUpdate()
public bool TestListenerPosition(Vector3 position)
Return true if they should hear this soundscape when in this position
No results match this filter.
Properties
Showing 8 properties
public Vector3 Sandbox.SoundscapeTrigger.BoxSize { get; set; }
The size of the Soundscape when `Sandbox.SoundscapeTrigger.Type` is set to `Sandbox.SoundscapeTrigger.TriggerType.Box`.
public bool Sandbox.SoundscapeTrigger.Playing { get; set; }
public float Sandbox.SoundscapeTrigger.Radius { get; set; }
The radius of the Soundscape when `Sandbox.SoundscapeTrigger.Type` is set to `Sandbox.SoundscapeTrigger.TriggerType.Sphere`.
public Sandbox.Soundscape Sandbox.SoundscapeTrigger.Soundscape { get; set; }
public bool Sandbox.SoundscapeTrigger.StayActiveOnExit { get; set; }
When true the soundscape will keep playing after exiting the area, and will only stop playing once another soundscape takes over.
public Sandbox.Audio.MixerHandle Sandbox.SoundscapeTrigger.TargetMixer { get; set; }
The mixer that the soundscape will play on.
public Sandbox.SoundscapeTrigger.TriggerType Sandbox.SoundscapeTrigger.Type { get; set; }
Determines when/where the soundscape can be heard.
public float Sandbox.SoundscapeTrigger.Volume { get; set; }
No results match this filter.
Metadata
| Field | Value |
|---|---|
| Namespace | Sandbox |
| Type | class |
| Assembly | Sandbox.Engine |
| Doc ID | T:Sandbox.SoundscapeTrigger |