Aspect concepts
Warning
Aspects are deprecated and will be removed in a future release. Use component access and query methods directly instead.
An aspect is an object-like wrapper that you can use to group together a subset of an entity's components into a single C# struct. Aspects are useful for organizing component code and simplifying queries in your systems. Unity provides predefined aspects for groups of related components or you can define your own with the IAspect interface.
Aspects can include items such as the following:
- A single
Entityfield to store the entity's ID RefRW<T>andRefRO<T>fields to access component data of typeT, whereTimplementsIComponentData.EnabledRefRWandEnabledRefROfields to access the enabled state of components that implementIEnableableComponent.DynamicBuffer<T>fields to access the buffer elements that implementIBufferElementData- Any
ISharedComponentfields to access the shared component value as read-only. - Other aspect types