2019-05-12 02:42:27 +00:00
|
|
|
#include "soundEmitterObject.h"
|
2019-03-05 03:44:00 +00:00
|
|
|
|
|
|
|
|
IMPLEMENT_CO_NETOBJECT_V1(SoundEmitterObject);
|
|
|
|
|
|
|
|
|
|
SoundEmitterObject::SoundEmitterObject()
|
|
|
|
|
: mSoundComponent(nullptr)
|
|
|
|
|
{
|
2019-05-12 02:42:27 +00:00
|
|
|
mSuperClassName = StringTable->insert("Entity");
|
2019-03-05 03:44:00 +00:00
|
|
|
}
|
|
|
|
|
SoundEmitterObject::~SoundEmitterObject()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool SoundEmitterObject::onAdd()
|
|
|
|
|
{
|
|
|
|
|
if (!Parent::onAdd())
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
//Sound
|
|
|
|
|
mSoundComponent = new SoundComponent();
|
|
|
|
|
if (!mSoundComponent->registerObject())
|
|
|
|
|
{
|
|
|
|
|
Con::errorf("SoundEmitterObject::onAdd - unable to add soundComponent!");
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
mSoundComponent->setInternalName("soundComponent");
|
|
|
|
|
|
|
|
|
|
addComponent(mSoundComponent);
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void SoundEmitterObject::onRemove()
|
|
|
|
|
{
|
|
|
|
|
Parent::onRemove();
|
2019-05-12 02:42:27 +00:00
|
|
|
}
|