When using a PlaySoundOnEntity Event, you no longer have to provide the child of an entity as parameter.

This commit is contained in:
stiffly
2016-02-10 11:04:18 +01:00
parent 2c64ffc3d1
commit 94ff12cf66
5 changed files with 15 additions and 26 deletions
+1 -4
View File
@@ -197,10 +197,7 @@ void PlayerMovementSystem::playerStep(double dt)
// Player moved a step's distance
// Create footstep sound
Events::PlaySoundOnEntity e;
EntityID child = m_World->CreateEntity(m_LocalPlayer.ID);
m_World->AttachComponent(child, "Transform");
m_World->AttachComponent(child, "SoundEmitter");
e.EmitterID = child;
e.EmitterID = m_LocalPlayer.ID;
e.FilePath = m_LeftFoot ? "Audio/footstep/footstep2.wav" : "Audio/footstep/footstep3.wav";
m_LeftFoot = !m_LeftFoot;
m_EventBroker->Publish(e);