decline-cookies / anvil-unity-dots

Unity DOTS and ECS specific additions and extensions to Anvil

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Entity Spawner supporting Proxy Entities

jkeon opened this issue · comments

We don't have a nice way to spawn proxy entities right now but there is a potential way to nest the proxy definition inside the definition itself.

Take an example CrewActorDefinition that wants to also have a FollowPath proxy entity from a FollowPathProxyEntityDefinition.

  • The Crew Actor Definition will expose through the interface a list of all IEntitySpawnDefinitions that should be spawned as Proxy Entities.
  • The Spawner system will grab those and ensure that we have a lookup for the Archetypes to be able to spawn the right type of entity.
  • The Crew Actor Definition will explicitly create the Proxy Entities by virtue of having the typed ProxyEntityDefinition as part of it. Ex. private FollowPathProxyEntityDefintion m_FollowPathProxyEntityDefinition;
  • This should allow for Burst jobs to create both entities as part of the same ECB and link the linker components properly.

This will also remove any frame delays which is really really good and will allow for that Proxy Entity Definition to define it's own Proxy Entity Defintitions too.

Duplicate of #192