|
|
|
@ -50,14 +50,17 @@ public unsafe class EntityRef |
|
|
|
|
=> ecs_delete(World, this); |
|
|
|
|
|
|
|
|
|
public EntityBuilder NewChild(EntityPath? path = null) |
|
|
|
|
=> World.New(EnsureRelativePath(path)).ChildOf(this); |
|
|
|
|
=> World.New(this, EnsureRelativePath(path)); |
|
|
|
|
public EntityRef? LookupChild(EntityPath path) |
|
|
|
|
=> World.LookupByPath(this, EnsureRelativePath(path)!); |
|
|
|
|
public EntityRef LookupChildOrThrow(EntityPath path) |
|
|
|
|
=> World.LookupByPathOrThrow(this, EnsureRelativePath(path)!); |
|
|
|
|
|
|
|
|
|
private static EntityPath? EnsureRelativePath(EntityPath? path) |
|
|
|
|
{ if (path?.IsAbsolute == true) throw new ArgumentException("path must not be absolute", nameof(path)); return path; } |
|
|
|
|
{ |
|
|
|
|
if (path?.IsAbsolute == true) throw new ArgumentException( |
|
|
|
|
$"Path '{path}' must not be absolute", nameof(path)); return path; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public EntityRef? Parent |
|
|
|
|