Open guerro323 opened 3 years ago
Relative Entities are not yet introduced, but non-hardcoded Linked Entities got included in GameHost.Simulation.V3:
// Add LinkedEntity feature
world.AddLinkedEntityModule();
var a = world.CreateEntity();
var b = world.CreateEntity();
// Link B (child) to A (parent)
world.SetLink(b, a, true);
// Destroy A, which will destroy B
world.DestroyEntity(a);
The behavior is the same as the previous version
Done!
world.AddRelativeEntityModule();
ComponentType playerType = world.RegisterRelativeDescription("PlayerDescription");
world.AddRelative(playerType, projectile, player);
world.RemoveRelative(playerType, projectile);
if (world.TryGetRelative(playerType, projectile, out var player)) {}
Span<UEntityHandle> ownedRelatives = world.ReadOwnedRelatives(playerType, player);
Big difference between the old version of relative entities:
The terminology will need to be remade, so the issue will still be up
This feature will be for later once GameHost.V3 is half done.
Introduce Relative entities, which link an entity with another one based on a description. (eg: a character linked to a player) This feature shouldn't be hardcoded into GameWorld code. Entity Links should also be modified to work in the same way as Relative Entities (aka not be hard coded)
Example: