๐๏ธ Overview
Components are used to parametrize the behaviors per entity. A simple example is GoForwardAuthoring, which adds the GoForwardComponent to an entity. This component's data can then be used inside the Execute method of GoForwardJob, where it's passed in as EntityInformation.
๐๏ธ Component Creation
A component in ECS is a little bit more work to set up than when using normal GameObjects. For example, the following is code needed for GoForwardComponent. There are three parts.
๐๏ธ ISimpleBaseBehavior
Components to be used with simple behaviors must implement ISimpleBaseBehavior. It requires the component to have SimpleBehaviorData member with these fields which are internally used by the framework:
๐๏ธ INeighborBaseBehavior
Components to be used with neighbor behaviors must implement INeighborBaseBehavior. It requires the component to have NeighborBehaviorData member with fields which are internally used by the framework. The fields are the same with ISimpleBaseBehavior, with the addition of:
๐๏ธ IRayBaseBehavior
Components to be used with ray behaviors must implement IRayBaseBehavior. It requires the component to have RayBehaviorData member with fields which are internally used by the framework. The fields are the same with ISimpleBaseBehavior, with the addition of:
๐๏ธ Tags
Tag components are components with no properties. Their main usage is to uniquely identify all entities which share the same tag - for example all birds in 9. Full Example have BirdTagComponent. Entity Queries can match entities with a given tag. The tags can also be used in Neighbor Queries to filter out potential neighbors.