This commit is contained in:
Simon Lübeß
2024-03-10 13:01:05 +01:00
parent 8d92822845
commit 72bd152999
3 changed files with 122 additions and 79 deletions
+6
View File
@@ -9,6 +9,7 @@ using GlitchyEngine.Scripting;
using GlitchyEngine.Math;
using GlitchyEngine.Scripting.Classes;
using GlitchyEngine.Serialization;
using GlitchyEngine.World.Components;
namespace GlitchyEngine.World
{
@@ -800,6 +801,11 @@ namespace GlitchyEngine.World
let nameComponent = entity.AddComponent<NameComponent>();
nameComponent.Name = (name.IsEmpty ? "Entity" : name);
#if GE_EDITOR
// Only add the editor flags if we are indeed in an editor
entity.AddComponent<EditorFlagsComponent>();
#endif
// If no id is given generate a random one.
IDComponent idComponent = (id == default) ? IDComponent() : IDComponent(id);