Game.Prefabs.NotificationIconData
Assembly: Game (inferred from project structure)
Namespace: Game.Prefabs
Type: struct
Base: System.ValueType
Implements: Unity.Entities.IComponentData, Unity.Entities.IQueryTypeParameter, Colossal.Serialization.Entities.IEmptySerializable
Summary:
A small ECS component used by the game to hold an EntityArchetype reference for notification icon prefabs. As a value-type component it can be attached to entities so systems can read which archetype should be used when spawning or managing notification icons. The implemented interfaces indicate it is a standard ECS component, can be used as a query type parameter, and participates in the project's custom serialization conventions.
Fields
public Unity.Entities.EntityArchetype m_Archetype
Holds an EntityArchetype instance that typically defines the set of components/prefab layout for a notification icon. Systems can read this archetype to create new icon entities or to compare expected prefab layouts.
Properties
- (none)
This struct exposes no properties — only a public field. Use the field directly when reading or writing component data.
Constructors
public NotificationIconData()
Structs in C# have an implicit parameterless constructor that initializes fields to their default values. In this case m_Archetype will be default-initialized (an invalid/empty archetype) until explicitly assigned.
Methods
- (none)
This type declares no methods. Behavior is provided by systems that read or write this component on entities.
Usage Example
using Unity.Entities;
public class NotificationIconExample
{
public void CreateNotificationIcon(EntityManager entityManager)
{
// Create an archetype for the icon entity (replace with real component types required by your icon)
var iconArchetype = entityManager.CreateArchetype(typeof(SomeIconComponent), typeof(Transform));
// Create an entity that will store the archetype reference
var holderEntity = entityManager.CreateEntity();
entityManager.AddComponentData(holderEntity, new Game.Prefabs.NotificationIconData
{
m_Archetype = iconArchetype
});
// Later, a system can read m_Archetype and use it to spawn icon entities:
// var newIcon = entityManager.CreateEntity(iconArchetype);
}
}
Notes: - Because this is a simple data container component, systems are expected to provide the logic for creating or managing notification icon entities using the stored archetype. - The presence of IEmptySerializable is part of the game's/custom serializer infrastructure — follow the project's serialization conventions when persisting or cloning entities with this component.