feat: allow game registering of components
This commit is contained in:
@@ -24,6 +24,8 @@
|
||||
#include <string_view>
|
||||
|
||||
#include "imgui.h"
|
||||
#include "components/GameComponentRegistry.h"
|
||||
#include "components/PrintComponent.h"
|
||||
#include "destrum/Components/Physics/SphereCollider.h"
|
||||
#include "destrum/Util/ModelDocUtils.h"
|
||||
|
||||
@@ -60,6 +62,8 @@ LightKeeper::~LightKeeper()
|
||||
|
||||
void LightKeeper::customInit()
|
||||
{
|
||||
RegisterGameComponents();
|
||||
|
||||
resources.init(gfxDevice);
|
||||
renderer.init(gfxDevice, resources, m_params.renderSize);
|
||||
|
||||
@@ -426,6 +430,12 @@ void LightKeeper::customInit()
|
||||
|
||||
sphereMaterial = resources.materials().addSimpleColorMaterial({0.5f, 0.3f, 0.8f}, "Blue");
|
||||
|
||||
|
||||
auto obj = scene.CreateGameObject("GameObject");
|
||||
auto printComp = obj->AddComponent<PrintComponent>();
|
||||
printComp->SetMessage("Testing");
|
||||
|
||||
|
||||
}
|
||||
|
||||
void LightKeeper::customUpdate(float dt)
|
||||
|
||||
Reference in New Issue
Block a user