mirror of
https://github.com/antopilo/Nuake.git
synced 2026-09-15 20:08:54 +03:00
Prefab editor now somewhat works with live-reload
This commit is contained in:
@@ -975,7 +975,7 @@ namespace Nuake {
|
||||
|
||||
if (!savePath.empty())
|
||||
{
|
||||
newPrefab->SaveAs(savePath);
|
||||
newPrefab->SaveAs(FileSystem::AbsoluteToRelative(savePath));
|
||||
Selection.Entity.AddComponent<PrefabComponent>().PrefabInstance = newPrefab;
|
||||
FileSystem::Scan();
|
||||
FileSystemUI::m_CurrentDirectory = FileSystem::RootDirectory;
|
||||
@@ -2282,7 +2282,9 @@ namespace Nuake {
|
||||
char* file = (char*)payload->Data;
|
||||
std::string fullPath = std::string(file, 256);
|
||||
std::string relPath = FileSystem::AbsoluteToRelative(fullPath);
|
||||
Prefab::New(relPath);
|
||||
auto newPrefabInstance = Prefab::New(relPath);
|
||||
newPrefabInstance->Root.GetComponent<PrefabComponent>().SetPrefab(newPrefabInstance);
|
||||
newPrefabInstance->Root.GetComponent<NameComponent>().IsPrefab = true;
|
||||
}
|
||||
ImGui::EndDragDropTarget();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user