Class Sound
A queueable sound.
Inheritance
System.Object
Sound
Namespace: Mannequin.Bindings
Assembly: Collapse.dll
Syntax
public class Sound : object
Examples
Play a sound when an Agent dies.
Mannequin:Import("Event")
Mannequin:Import("Sound")
local mySound = nil
-- Content can't be loaded before ContentReady
Event.On("ContentReady", function()
mySound = Sound("sfx/gunshot_9mm")
end)
Event.On("AgentDeath", function(deathinfo)
mySound:Queue()
end)
Constructors
Sound(String)
Declaration
public Sound(string loc)
Parameters
Type | Name | Description |
---|---|---|
System.String | loc |
Properties
id
The ID (location) of this Sound.
Declaration
public string id { get; }
Property Value
Type | Description |
---|---|
System.String |
Methods
Queue(Point, Single)
Queue the sound for playing.
Declaration
public void Queue(Point pos = null, float volume = null)
Parameters
Type | Name | Description |
---|---|---|
Point | pos | Play the sound at this position in the current Scene (default: (0,0)) |
System.Single | volume | Play the sound at this volume |