Added test code for scripts

This commit is contained in:
Kah Wei 2022-09-22 11:22:51 +08:00
parent b04789945f
commit 21a3d6ecd7
1 changed files with 3 additions and 0 deletions

View File

@ -7,6 +7,7 @@
#include "Graphics/MiddleEnd/Interface/SHRenderable.h" #include "Graphics/MiddleEnd/Interface/SHRenderable.h"
#include "Scene/SHSceneManager.h" #include "Scene/SHSceneManager.h"
#include "Graphics/MiddleEnd/Interface/SHGraphicsSystem.h" #include "Graphics/MiddleEnd/Interface/SHGraphicsSystem.h"
#include "Scripting/SHScriptEngine.h"
using namespace SHADE; using namespace SHADE;
@ -42,6 +43,8 @@ namespace Sandbox
renderable.Mesh = CUBE_MESH; renderable.Mesh = CUBE_MESH;
renderable.SetMaterial(matInst); renderable.SetMaterial(matInst);
renderable.TransformMatrix.Translate(0.0f, 0.0f, 2.0f); renderable.TransformMatrix.Translate(0.0f, 0.0f, 2.0f);
SHADE::SHScriptEngine* scriptEngine = static_cast<SHADE::SHScriptEngine*>(SHADE::SHSystemManager::GetSystem<SHADE::SHScriptEngine>());
scriptEngine->AddScript(*SHADE::SHEntityManager::GetEntityByID(entity), "TestScript");
} }
void SBTestScene::Update(float dt) void SBTestScene::Update(float dt)
{ {