mirror of
https://github.com/antopilo/Nuake.git
synced 2026-09-09 20:08:57 +03:00
can now load models through model panel
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
#include <src/Scene/Components/MeshComponent.h>
|
||||
|
||||
#include <src/Resource/ResourceLoader.h>
|
||||
#include <src/Core/String.h>
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ void EditorSelectionPanel::ResolveFile(Ref<Nuake::File> file)
|
||||
|
||||
if (currentFile->GetExtension() == ".material")
|
||||
{
|
||||
Ref<Material> material = ResourceLoader::LoadResource(currentFile->GetRelativePath());
|
||||
Ref<Material> material = ResourceLoader::LoadMaterial(currentFile->GetRelativePath());
|
||||
selectedResource = material;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user