mirror of
https://github.com/antopilo/Nuake.git
synced 2026-09-04 11:35:06 +03:00
Added Editor Update to scene systems
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
#include "TrenchbroomSystem.h"
|
||||
|
||||
#include "src/Scene/Scene.h"
|
||||
#include "src/Scene/Components/QuakeMap.h"
|
||||
|
||||
namespace Nuake
|
||||
{
|
||||
TrenchbroomSystem::TrenchbroomSystem(Scene* scene)
|
||||
@@ -22,6 +25,16 @@ namespace Nuake
|
||||
|
||||
}
|
||||
|
||||
void TrenchbroomSystem::EditorUpdate()
|
||||
{
|
||||
auto quakeMapView = m_Scene->m_Registry.view<QuakeMapComponent>();
|
||||
for (auto e : quakeMapView)
|
||||
{
|
||||
const auto& quakeMapComponent = quakeMapView.get<QuakeMapComponent>(e);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
void TrenchbroomSystem::Exit()
|
||||
{
|
||||
|
||||
|
||||
@@ -8,9 +8,13 @@ namespace Nuake
|
||||
public:
|
||||
TrenchbroomSystem(Scene* scene);
|
||||
bool Init() override;
|
||||
void Update(Timestep ts) override;
|
||||
|
||||
void Draw() override {}
|
||||
|
||||
void Update(Timestep ts) override;
|
||||
void FixedUpdate(Timestep ts) override;
|
||||
void EditorUpdate() override;
|
||||
|
||||
void Exit() override;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -2,10 +2,15 @@
|
||||
#include "wren.h"
|
||||
#include <string>
|
||||
#include <src/Core/Logger.h>
|
||||
|
||||
#include "ScriptModule.h"
|
||||
|
||||
#include <iostream>
|
||||
#include <wren.h>
|
||||
#include "Engine.h"
|
||||
|
||||
#include "src/Core/Physics/PhysicsManager.h"
|
||||
|
||||
#include "../Scene/Entities/Entity.h"
|
||||
#include <src/Scene/Components/TransformComponent.h>
|
||||
#include <src/Scene/Components/LightComponent.h>
|
||||
@@ -194,7 +199,7 @@ namespace Nuake {
|
||||
double handle = wrenGetSlotDouble(vm, 1);
|
||||
Entity ent = Entity((entt::entity)handle, Engine::GetCurrentScene().get());
|
||||
auto& characterController = ent.GetComponent<CharacterControllerComponent>();
|
||||
bool result = characterController.CharacterController->IsOnGround;
|
||||
bool result = PhysicsManager::Get().GetWorld()->IsCharacterGrounded(ent);
|
||||
wrenSetSlotBool(vm, 0, result);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user