Game.Prefabs.ServiceUpgradeBuilding
Assembly: Assembly-CSharp (game assembly)
Namespace: Game.Prefabs
Type: struct
Base: Unity.Entities.IBufferElementData
Summary:
Container type used as a DynamicBuffer element that holds a reference to a building Entity used for service upgrade purposes. It is a plain data-only struct (no behavior) used by the Unity.Entities (DOTS) runtime. The struct is annotated with [InternalBufferCapacity(1)], reserving space for one element per chunk before the buffer spills to heap memory.
Fields
public Unity.Entities.Entity m_Building
Holds the Entity that represents the building associated with this service upgrade entry. This is a straight Entity reference (Unity.Entities.Entity).
Properties
- This type has no properties.
Constructors
public ServiceUpgradeBuilding(Entity building)
Constructs a new ServiceUpgradeBuilding buffer element and sets m_Building to the provided building Entity.
Methods
- This type has no methods.
Usage Example
// Assume entityManager is available and buildingEntity is an existing Entity
Entity upgradeEntity = entityManager.CreateEntity();
var buffer = entityManager.AddBuffer<Game.Prefabs.ServiceUpgradeBuilding>(upgradeEntity);
// Add the building reference to the buffer
buffer.Add(new Game.Prefabs.ServiceUpgradeBuilding(buildingEntity));
Notes:
- Because the struct implements IBufferElementData, it is intended for use with DynamicBuffer