various bug fix, serialization, adding shapes
This commit is contained in:
@@ -25,7 +25,8 @@ namespace OpenEngine {
|
||||
RegisterDrawer<MeshComponent>("Mesh", &MeshOnImGuiRender);
|
||||
RegisterDrawer<MaterialComponent>("Material", &MaterialOnImGuiRender);
|
||||
RegisterDrawer<PhysicsBodyComponent>("Physics Body", &BodyOnImGuiRender);
|
||||
RegisterDrawer<PhysicsShapeComponent>("Physics Shape", &ShapeOnImGuiRender);
|
||||
RegisterDrawer<SphereShapeComponent>("Sphere Shape", &SphereShapeOnImGuiRender);
|
||||
RegisterDrawer<BoxShapeComponent>("Box Shape", &BoxShapeOnImGuiRender);
|
||||
|
||||
scene = context;
|
||||
selected_context = {};
|
||||
@@ -64,9 +65,14 @@ namespace OpenEngine {
|
||||
selected_context.AddComponent<PhysicsBodyComponent>();
|
||||
ImGui::CloseCurrentPopup();
|
||||
}
|
||||
if (!selected_context.HasComponent<PhysicsShapeComponent>())
|
||||
if (ImGui::MenuItem("Physics shape")) {
|
||||
selected_context.AddComponent<PhysicsShapeComponent>();
|
||||
if (!selected_context.HasComponent<SphereShapeComponent>())
|
||||
if (ImGui::MenuItem("Sphere shape")) {
|
||||
selected_context.AddComponent<SphereShapeComponent>();
|
||||
ImGui::CloseCurrentPopup();
|
||||
}
|
||||
if (!selected_context.HasComponent<BoxShapeComponent>())
|
||||
if (ImGui::MenuItem("Box shape")) {
|
||||
selected_context.AddComponent<BoxShapeComponent>();
|
||||
ImGui::CloseCurrentPopup();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user