Game.Prefabs.CityBoundaryData
Assembly: Assembly-CSharp
Namespace: Game.Prefabs
Type: struct
Base: System.ValueType, IComponentData, IQueryTypeParameter
Summary:
CityBoundaryData is an empty/tag ECS component used to mark entities that represent the city's boundary. The type is decorated with [StructLayout(LayoutKind.Sequential, Size = 1)] to ensure the struct occupies at least one byte (useful for some interop or layout assumptions and to avoid zero-sized type issues). As an IComponentData it can be attached to ECS entities and used in queries or to select entities in systems; as an IQueryTypeParameter it can be used directly in EntityQuery or Entities API filtering.
Fields
- None.
This is a tag component with no instance fields. The StructLayout(Size = 1) attribute gives it a non-zero size despite having no managed fields.
Properties
- None.
Constructors
public CityBoundaryData()
Default value-type constructor (implicit). No custom construction logic.
Methods
- None.
Usage Example
// Add the tag component to a created entity
var entityManager = World.DefaultGameObjectInjectionWorld.EntityManager;
var boundaryEntity = entityManager.CreateEntity(typeof(Game.Prefabs.CityBoundaryData));
// Query entities tagged with CityBoundaryData in a SystemBase
public partial class BoundaryProcessingSystem : SystemBase
{
protected override void OnUpdate()
{
Entities
.WithAll<Game.Prefabs.CityBoundaryData>()
.ForEach((Entity entity) =>
{
// process boundary entity
})
.WithoutBurst()
.Run();
}
}