instantiate EditorCameraSystem and add EditorCameraComponent to main camera
This commit is contained in:
@@ -1,5 +1,7 @@
|
|||||||
#include <NazaraEditor/Core/Application/BaseApplication.hpp>
|
#include <NazaraEditor/Core/Application/BaseApplication.hpp>
|
||||||
|
#include <NazaraEditor/Core/Components/CameraComponent.hpp>
|
||||||
#include <NazaraEditor/Core/Components/NameComponent.hpp>
|
#include <NazaraEditor/Core/Components/NameComponent.hpp>
|
||||||
|
#include <NazaraEditor/Core/Systems/CameraSystem.hpp>
|
||||||
|
|
||||||
namespace Nz
|
namespace Nz
|
||||||
{
|
{
|
||||||
@@ -84,6 +86,8 @@ namespace Nz
|
|||||||
bool bRes = m_level.CreateNewLevel();
|
bool bRes = m_level.CreateNewLevel();
|
||||||
if (bRes)
|
if (bRes)
|
||||||
{
|
{
|
||||||
|
m_level.GetEnttWorld()->AddSystem<EditorCameraSystem>();
|
||||||
|
|
||||||
// configure camera
|
// configure camera
|
||||||
m_mainCamera = CreateEntity("MainCamera");
|
m_mainCamera = CreateEntity("MainCamera");
|
||||||
auto& cmp = m_mainCamera.get<Nz::EditorNameComponent>();
|
auto& cmp = m_mainCamera.get<Nz::EditorNameComponent>();
|
||||||
@@ -93,6 +97,8 @@ namespace Nz
|
|||||||
cameraComponent.UpdateFOV(70.f);
|
cameraComponent.UpdateFOV(70.f);
|
||||||
cameraComponent.UpdateClearColor(Nz::Color(0.46f, 0.48f, 0.84f, 1.f));
|
cameraComponent.UpdateClearColor(Nz::Color(0.46f, 0.48f, 0.84f, 1.f));
|
||||||
|
|
||||||
|
auto& editorcam = m_mainCamera.emplace<Nz::EditorCameraComponent>();
|
||||||
|
|
||||||
OnLevelChanged(m_level);
|
OnLevelChanged(m_level);
|
||||||
}
|
}
|
||||||
return bRes;
|
return bRes;
|
||||||
|
|||||||
Reference in New Issue
Block a user