Game.EndFrameBarrier
Assembly: Assembly-CSharp
Namespace: Game.Simulation
Type: struct
Base: IComponentData, IQueryTypeParameter, ISerializable
Summary:
BiomeData is a small ECS component (value type) that holds a reference to a biome prefab Entity. It implements ISerializable so the contained Entity reference can be written to and read from the game's serialization system (Colossal.Serialization). It also implements IQueryTypeParameter to be usable as a query parameter/type marker in Entity queries.
Fields
public Unity.Entities.Entity m_BiomePrefab
Holds the Entity that represents the biome prefab. This field is serialized/deserialized by the ISerializable implementation so that references to the prefab are preserved across save/load.
Properties
- (none)
This struct exposes no properties; it is a plain data component with a single public field.
Constructors
public BiomeData(Entity prefab)
Creates a new BiomeData instance and sets the m_BiomePrefab field to the provided prefab Entity.
Methods
-
public void Deserialize<TReader>(TReader reader) where TReader : IReader
Reads the biome prefab Entity from the provided reader and stores it in m_BiomePrefab. Used by the game's serialization system when loading component data. -
public void Serialize<TWriter>(TWriter writer) where TWriter : IWriter
Writes the m_BiomePrefab Entity to the provided writer. Used by the game's serialization system when saving component data.
Usage Example
// Create the component with a reference to a biome prefab entity, then add it to an entity:
Entity biomePrefab = /* obtain prefab entity reference */;
BiomeData data = new BiomeData(biomePrefab);
entityManager.AddComponentData(targetEntity, data);
// The game's serialization system will call Serialize/Deserialize automatically
// when saving/loading entities that have this component.