Game.Areas.Navigation
Assembly:
Likely Assembly-CSharp (game/mod assembly)
Namespace: Game.Areas
Type: struct
Base: System.ValueType
Implements: Unity.Entities.IComponentData, Unity.Entities.IQueryTypeParameter, Colossal.Serialization.Entities.IEmptySerializable
Summary:
Navigation is an empty/tag ECS component used to mark entities that participate in the game's navigation/area systems. The struct is explicitly given a non-zero size via [StructLayout(LayoutKind.Sequential, Size = 1)] to ensure compatibility with serialization and native layout expectations. Because it implements IComponentData it can be attached to ECS entities; IQueryTypeParameter allows its use in query expressions; IEmptySerializable indicates it participates in the Colossal serialization pipeline despite containing no fields.
Fields
- This type declares no managed fields. {{ This struct contains no fields — it is used purely as a tag component. The StructLayout attribute enforces a 1-byte size so serializers and native code treat it as non-empty. }}
Properties
- This type exposes no properties. {{ No properties are defined or required — behavior is expressed by presence/absence of the component on an entity. }}
Constructors
- public Navigation()
{{ Navigation uses the default value-type constructor (no custom constructors). To create the component, use
new Navigation()
or rely on APIs that add the component without explicit construction. }}
Methods
- This type declares no methods. {{ There are no instance methods; the component's role is to be added/removed from entities and used in queries or system logic. }}
Usage Example
// Add the tag to an entity via EntityManager
var nav = new Game.Areas.Navigation();
entityManager.AddComponentData(entity, nav);
// or when creating an archetype
var archetype = entityManager.CreateArchetype(
typeof(Game.Areas.Navigation),
/* other components */
);
// Querying entities that have the Navigation tag in a SystemBase
Entities
.WithAll<Game.Areas.Navigation>()
.ForEach((Entity e, in SomeOtherComponent soc) =>
{
// handle navigation-related entity
}).Schedule();
{{ Use this component as a marker to include/exclude entities in systems that implement navigation behavior. Remember the struct is intentionally empty — all logic should come from systems that react to its presence. }}