Game.IconConfigurationData
Assembly:
Assembly-CSharp (typical Unity runtime assembly; replace with actual assembly if different)
Namespace: Game.Prefabs
Type:
struct
Base:
IComponentData, IQueryTypeParameter
Summary:
A lightweight ECS component that stores references to two marker entities used by an icon / selection system: the marker shown for the currently selected object, and the marker used for the object being followed. Both fields are plain Entity references (blittable), so this component is suitable for use in Jobs and ECS queries.
Fields
-
public Unity.Entities.Entity m_SelectedMarker
Reference to the Entity that represents the "selected" marker. Typical value is an Entity handle to a prefab or instantiated marker. If no marker is assigned, this will normally be Entity.Null. -
public Unity.Entities.Entity m_FollowedMarker
Reference to the Entity that represents the "followed" marker (e.g., the icon shown when the camera or UI is following an object). Also an Entity handle; use Entity.Null when not set.
Properties
- None.
This component exposes only public fields and does not provide properties.
Constructors
- Implicit default constructor (value type)
No explicit constructors are defined. When created, both Entity fields default to Entity.Null.
Methods
- None.
This struct is a plain data container (IComponentData) and does not implement methods. It can be used directly in Systems, Jobs, and queries.
Usage Example
// Create an entity with the IconConfigurationData component and set markers:
var entityManager = World.DefaultGameObjectInjectionWorld.EntityManager;
var iconEntity = entityManager.CreateEntity(typeof(Game.Prefabs.IconConfigurationData));
// Assume selectedMarkerEntity and followedMarkerEntity are existing Entity handles:
entityManager.SetComponentData(iconEntity, new Game.Prefabs.IconConfigurationData {
m_SelectedMarker = selectedMarkerEntity,
m_FollowedMarker = followedMarkerEntity
});
// Example of reading the component inside a SystemBase:
Entities
.WithName("UseIconConfig")
.ForEach((in Game.Prefabs.IconConfigurationData iconConfig) =>
{
var selected = iconConfig.m_SelectedMarker;
var followed = iconConfig.m_FollowedMarker;
// Use the entity references (e.g., update marker positions, toggle visibility)
})
.Schedule();
{{ Additional notes: - Because this is a pure IComponentData struct containing Entity fields, it is safe to use in Jobs and Burst-compiled code. - Fields are public for direct access to avoid additional copying or accessor overhead. - If you need to serialize or expose these in authoring components, create a MonoBehaviour authoring script that converts authoring references (e.g., GameObject prefabs) into Entity handles during baking/authoring. }}