Game.Prefabs.CompanyBrandElement
Assembly: Assembly-CSharp
Namespace: Game.Prefabs
Type: struct
Base: System.ValueType, Unity.Entities.IBufferElementData
Summary:
Represents a single buffer element that stores a reference to a "brand" Entity (e.g., a company brand prefab). The struct is annotated with InternalBufferCapacity(0), so the dynamic buffer has no inline storage and will allocate externally as needed. This type implements IBufferElementData and is intended to be used with Unity.Entities.DynamicBuffer
Fields
public Unity.Entities.Entity m_Brand
Holds the Entity reference for a company brand. This is the payload of the buffer element and can be added to or read from a DynamicBufferattached to an entity.
Properties
- None.
Constructors
public CompanyBrandElement(Unity.Entities.Entity brand)
Initializes a new CompanyBrandElement with the given brand Entity.
Methods
- None.
Usage Example
// Add a dynamic buffer of CompanyBrandElement to an entity and add a brand entity to it.
var buffer = entityManager.AddBuffer<Game.Prefabs.CompanyBrandElement>(companyEntity);
buffer.Add(new Game.Prefabs.CompanyBrandElement(brandEntity));
// Read all brand entities from the buffer
var brands = entityManager.GetBuffer<Game.Prefabs.CompanyBrandElement>(companyEntity);
foreach (var b in brands)
{
Entity brandEntity = b.m_Brand;
// use brandEntity...
}