Game.Prefabs.Climate.ClimateData
Assembly: Assembly-CSharp
Namespace: Game.Prefabs.Climate
Type: struct
Base: IComponentData, IQueryTypeParameter
Summary:
ClimateData is an intentionally empty marker component used by the ECS to tag entities/prefabs that are related to the game's climate system. It is decorated with StructLayout(LayoutKind.Sequential, Size = 1) so the struct occupies one byte (avoiding a zero-sized type). Implementing IComponentData makes it a Unity ECS component; implementing IQueryTypeParameter allows it to be used directly in query/type-parameter contexts (e.g., WithAll
Fields
- This struct declares no instance fields.
It is a marker/flag component; the StructLayout attribute enforces a one-byte size at runtime.
Properties
- None
Constructors
public ClimateData()
(implicit default)
Since ClimateData is a struct with no explicit constructors, a default parameterless constructor exists implicitly. The struct is trivially constructible.
Methods
- None
Usage Example
using Unity.Entities;
// Create an entity that is tagged as climate-related:
var entity = entityManager.CreateEntity(typeof(Game.Prefabs.Climate.ClimateData));
// Alternatively add the marker to an existing entity:
entityManager.AddComponent< Game.Prefabs.Climate.ClimateData >(existingEntity);
// Query entities that have the ClimateData marker:
Entities
.WithAll<Game.Prefabs.Climate.ClimateData>()
.ForEach((Entity e) =>
{
// handle climate-tagged entity
}).Run();