Game.Prefabs.InfoviewMode
Assembly: Assembly-CSharp
Namespace: Game.Prefabs
Type: struct
Base: Unity.Entities.IBufferElementData
Summary:
Represents a single entry in a DynamicBuffer that registers an infoview mode for an entity. Each element stores a reference to a mode Entity and metadata (priority, supplemental, optional). Marked with InternalBufferCapacity(0) so the entity has no inline buffer storage reserved by default; buffer storage will be allocated separately when needed. This is used by the game's infoview / UI mode management to collect and sort available infoview modes for an entity.
Fields
-
public Unity.Entities.Entity m_Mode
Entity reference for the infoview mode (likely a mode prefab/entity that implements or identifies a particular infoview behavior). -
public int m_Priority
Priority value used to determine ordering or selection of modes when multiple are available. -
public bool m_Supplemental
Flag indicating this mode is supplemental (e.g., additional information layered on top of primary modes). -
public bool m_Optional
Flag indicating the mode is optional (may be skipped or not shown depending on context).
Properties
- This type defines no properties. It is a plain buffer element (public fields) used for storage in a DynamicBuffer
.
Constructors
public InfoviewMode(Entity mode, int priority, bool supplemental, bool optional)
Creates a new InfoviewMode buffer element initializing all fields:- mode: the Entity that represents the mode
- priority: ordering priority
- supplemental: whether the mode is supplemental
- optional: whether the mode is optional
Methods
- This type declares no methods. It is a simple data container implementing IBufferElementData.
Usage Example
// Add a mode to an entity's infoview buffer
var em = World.DefaultGameObjectInjectionWorld.EntityManager;
Entity targetEntity = /* some entity that has the buffer */ ;
Entity modeEntity = /* the mode entity/prefab */ ;
// Ensure the entity has the buffer (e.g. via AddBuffer or via authoring)
if (!em.HasComponent<InfoviewMode>(targetEntity))
em.AddBuffer<InfoviewMode>(targetEntity);
var buffer = em.GetBuffer<InfoviewMode>(targetEntity);
buffer.Add(new InfoviewMode(modeEntity, priority: 10, supplemental: false, optional: true));
Notes:
- Because of [InternalBufferCapacity(0)], no elements are stored inline on the entity; the DynamicBuffer will allocate separately as elements are added.
- This struct is intended to be used in ECS systems that query and process DynamicBuffer