Game.Rendering.TerrainMaterialPropertiesData
Assembly: Game
Namespace: Game.Rendering
Type: struct
Base: IComponentData, IQueryTypeParameter
Summary:
TerrainMaterialPropertiesData is an empty (tag) ECS component used to mark entities that are associated with terrain material properties in the game's entity-component system. It has no fields and occupies a single byte (StructLayout(LayoutKind.Sequential, Size = 1)). The type includes a FormerlySerializedAs attribute for backwards compatibility with older serialized names. As a marker component, it is intended to be used in queries and to indicate the presence/association of terrain material data managed elsewhere (for example, in other components, shared components, or external systems).
Attributes
-
[StructLayout(LayoutKind.Sequential, Size = 1)]
Ensures the struct is laid out sequentially with an explicit size of 1 byte. This is typical for empty/tag ECS components so they still have a defined size when used in native structures. -
[FormerlySerializedAs("Colossal.Terrain.TerrainMaterialPropertiesData, Game")]
Allows serialized data written under the previous type name to be deserialized into this type (useful for compatibility across game/mod updates).
Fields
- None
This struct intentionally contains no fields (it's a tag/marker component). The explicit Size = 1 ensures it has a small, defined footprint.
Properties
- None
Constructors
- Default parameterless struct constructor is available (implicit).
You can create an instance withnew TerrainMaterialPropertiesData()
.
Methods
- None
Implements no methods; it acts purely as a marker implementing IComponentData and IQueryTypeParameter so it can be used in ECS queries.
Usage Example
// Add the marker component to an entity
entityManager.AddComponentData(entity, new TerrainMaterialPropertiesData());
// Query entities that have the marker component in a System
Entities.WithAll<TerrainMaterialPropertiesData>().ForEach((Entity e) =>
{
// handle entities associated with terrain material properties
});
Notes: - Because this is an empty marker component, actual terrain material values are expected to be stored elsewhere (in other components or resources). Use this component to identify or filter entities that should be processed by terrain-material-related systems. - The FormerlySerializedAs attribute helps keep save/load compatibility if the type name changed between versions of the game or mods.