diff --git a/Editor/src/ComponentsPanel/MeshPanel.h b/Editor/src/ComponentsPanel/MeshPanel.h index ebd7d479..b2093539 100644 --- a/Editor/src/ComponentsPanel/MeshPanel.h +++ b/Editor/src/ComponentsPanel/MeshPanel.h @@ -4,6 +4,7 @@ #include #include +#include class MeshPanel : ComponentPanel { @@ -32,8 +33,15 @@ public: std::string fullPath = std::string(file, 256); fullPath = Nuake::FileSystem::AbsoluteToRelative(fullPath); - //component.ModelPath = path; - //component.LoadModel(); + if (Nuake::String::EndsWith(fullPath, ".model")) + { + + } + else + { + component.ModelPath = fullPath; + component.LoadModel(); + } } ImGui::EndDragDropTarget(); } diff --git a/Editor/src/Windows/EditorSelectionPanel.cpp b/Editor/src/Windows/EditorSelectionPanel.cpp index fa2b0dc6..d6e9f438 100644 --- a/Editor/src/Windows/EditorSelectionPanel.cpp +++ b/Editor/src/Windows/EditorSelectionPanel.cpp @@ -28,7 +28,7 @@ void EditorSelectionPanel::ResolveFile(Ref file) if (currentFile->GetExtension() == ".material") { - Ref material = ResourceLoader::LoadResource(currentFile->GetRelativePath()); + Ref material = ResourceLoader::LoadMaterial(currentFile->GetRelativePath()); selectedResource = material; } }