Allow dragging and dropping of Entities in editor

+ New Dictionary Helpers
+ Made ImGui Payloads safer
+ Start of Component drag'n'drop
This commit is contained in:
Simon Lübeß
2023-07-24 23:17:00 +02:00
parent b53ed2d8f2
commit 37197cbdf1
19 changed files with 500 additions and 183 deletions
+9
View File
@@ -100,6 +100,15 @@ namespace GlitchyEngine.World
ScriptEngine.InitializeInstance(targetEntity, targetComponent);
}
// Copy values to entities.
// We do this in a separate loop because we might reference other entities.
// If we did it in a single loop these entities might not exist yet.
for (let (handle, script) in target._ecsWorld.Enumerate<ScriptComponent>())
{
Entity entity = .(handle, this);
ScriptEngine.CopyEditorFieldsToInstance(entity, script);
}
// Copy transforms... needs special handling for the Parent<->Child relations
for (let (sourceHandle, sourceTransform) in _ecsWorld.Enumerate<TransformComponent>())
{