1
0
forked from 0ad/0ad
0ad/binaries/data/mods/public/simulation/components/Sound.js
Ykkrosh 4c0d47707b # Fix animation syncing.
Make animations trigger sound effects.
Adjust attack animation timings to match simulation.
Simplify the animation speed settings.

This was SVN commit r7438.
2010-04-05 23:09:34 +00:00

23 lines
502 B
JavaScript

function Sound() {}
Sound.prototype.Init = function()
{
};
Sound.prototype.GetSoundGroup = function(name)
{
return this.template.SoundGroups[name] || "";
};
Sound.prototype.PlaySoundGroup = function(name)
{
if (name in this.template.SoundGroups)
{
var cmpSoundManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_SoundManager);
if (cmpSoundManager)
cmpSoundManager.PlaySoundGroup(this.template.SoundGroups[name], this.entity);
}
};
Engine.RegisterComponentType(IID_Sound, "Sound", Sound);