mirror of
https://github.com/antopilo/Nuake.git
synced 2026-09-15 20:08:54 +03:00
Fixed math problem and display submeshes in editor panel
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
#pragma once
|
||||
#include <src/Core/Core.h>
|
||||
#include "ComponentPanel.h"
|
||||
#include "ModelResourceInspector.h"
|
||||
|
||||
#include <src/Scene/Entities/ImGuiHelper.h>
|
||||
#include <src/Scene/Components/MeshComponent.h>
|
||||
|
||||
@@ -7,9 +10,14 @@
|
||||
#include <src/Core/String.h>
|
||||
|
||||
class MeshPanel : ComponentPanel {
|
||||
|
||||
private:
|
||||
Scope<ModelResourceInspector> _modelInspector;
|
||||
bool _expanded = false;
|
||||
public:
|
||||
MeshPanel() {}
|
||||
MeshPanel()
|
||||
{
|
||||
CreateScope<ModelResourceInspector>();
|
||||
}
|
||||
|
||||
void Draw(Nuake::Entity entity) override
|
||||
{
|
||||
@@ -23,7 +31,20 @@ public:
|
||||
ImGui::TableNextColumn();
|
||||
|
||||
std::string label = std::to_string(component.ModelResource->ID);
|
||||
ImGui::Button(label.c_str(), ImVec2(ImGui::GetContentRegionAvail().x, 0));
|
||||
if (ImGui::Button(label.c_str(), ImVec2(ImGui::GetContentRegionAvail().x, 0)))
|
||||
{
|
||||
if (!_expanded)
|
||||
{
|
||||
_modelInspector = CreateScope<ModelResourceInspector>(component.ModelResource);
|
||||
}
|
||||
|
||||
_expanded = !_expanded;
|
||||
}
|
||||
|
||||
if (_expanded)
|
||||
{
|
||||
_modelInspector->Draw();
|
||||
}
|
||||
|
||||
if (ImGui::BeginDragDropTarget())
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user