Changes:
- editor project - build system fixes - dummy data editor panels mock
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
#include "inspector_panel.hpp"
|
||||
|
||||
#include <imgui.h>
|
||||
|
||||
#include <cstdio>
|
||||
|
||||
void InspectorPanel::onUpdate(const sophia::FrameInfo&) {
|
||||
ImGui::Begin("Inspector");
|
||||
|
||||
char nameBuf[128];
|
||||
std::snprintf(nameBuf, sizeof(nameBuf), "%s", name.c_str());
|
||||
if (ImGui::InputText("Name", nameBuf, sizeof(nameBuf))) {
|
||||
name = nameBuf;
|
||||
}
|
||||
ImGui::Text("Tag: %s", tag.c_str());
|
||||
|
||||
ImGui::Separator();
|
||||
|
||||
if (ImGui::CollapsingHeader("Transform", ImGuiTreeNodeFlags_DefaultOpen)) {
|
||||
ImGui::DragFloat3("Position", &position.x, 0.1f);
|
||||
ImGui::DragFloat3("Rotation", &rotation.x, 0.1f);
|
||||
ImGui::DragFloat3("Scale", &scale.x, 0.1f);
|
||||
}
|
||||
|
||||
if (ImGui::CollapsingHeader("Mesh Renderer",
|
||||
ImGuiTreeNodeFlags_DefaultOpen)) {
|
||||
ImGui::Text("Mesh: %s", meshName.c_str());
|
||||
ImGui::Text("Material: %s", materialName.c_str());
|
||||
}
|
||||
|
||||
if (ImGui::CollapsingHeader("Script", ImGuiTreeNodeFlags_DefaultOpen)) {
|
||||
ImGui::Text("%s", scriptName.c_str());
|
||||
}
|
||||
|
||||
ImGui::End();
|
||||
}
|
||||
Reference in New Issue
Block a user