Unlocks mouse when changing to SpectatorCamera and locking when respawning.

This commit is contained in:
William Moberg
2016-03-04 09:49:27 +01:00
parent 7a2f1ac9fd
commit 0dfe00b406
4 changed files with 24 additions and 9 deletions
@@ -1,5 +1,6 @@
#include "Systems/SpectatorCameraSystem.h"
#include "Rendering/ESetCamera.h"
#include "Core/ELockMouse.h"
SpectatorCameraSystem::SpectatorCameraSystem(SystemParams params)
: System(params)
@@ -19,6 +20,8 @@ void SpectatorCameraSystem::Update(double dt)
Events::SetCamera eSetCamera;
eSetCamera.CameraEntity = spectatorCam;
m_EventBroker->Publish(eSetCamera);
Events::UnlockMouse unlock;
m_EventBroker->Publish(unlock);
}
}
}
@@ -60,6 +63,8 @@ bool SpectatorCameraSystem::OnInputCommand(const Events::InputCommand& e)
Events::SetCamera eSetCamera;
eSetCamera.CameraEntity = spectatorCam;
m_EventBroker->Publish(eSetCamera);
Events::UnlockMouse unlock;
m_EventBroker->Publish(unlock);
}
return true;