Game.UI.InGame.Notification
Assembly:
Assembly-CSharp
Namespace: Game.UI.InGame
Type:
readonly struct
Base:
System.ValueType
Summary:
Represents an immutable notification entry used by the in-game UI notification system. Encapsulates the source notification entity, an optional target entity, and the display priority (IconPriority). This struct is a small, copyable value type intended for passing notification data through ECS systems or UI code without mutation.
Fields
- This type declares no explicit fields (backing fields are compiler-generated for the auto-properties).
{{ The struct is declared readonly and only exposes get-only properties, so there are no publicly mutable fields to modify. }}
Properties
-
public Unity.Entities.Entity entity { get; }
{{ The source notification entity (Unity.Entities.Entity) that identifies the notification instance. Use this to reference the ECS entity that produced the notification. }} -
public Unity.Entities.Entity target { get; }
{{ The optional target entity associated with the notification (for example, the building or object the notification refers to). May be Entity.Null if no specific target is set. }} -
public Game.Notifications.IconPriority priority { get; }
{{ The IconPriority enum value indicating the visual priority or importance of the notification (controls ordering/visibility in the UI). }}
Constructors
public Notification(Unity.Entities.Entity entity, Unity.Entities.Entity target, Game.Notifications.IconPriority priority)
{{ Creates a new readonly Notification value populated with the provided source entity, target entity, and priority. Because the struct is readonly, all values are set at construction and cannot be changed afterward. }}
Methods
- This struct declares no methods beyond the compiler-provided ones (e.g., default Equals/GetHashCode/toString implementations).
{{ Use this as a plain data container — any behavior or processing should be done by systems or helper methods outside the struct. }}
Usage Example
using Game.UI.InGame;
using Game.Notifications;
using Unity.Entities;
// create a notification
Entity source = /* obtain or create notification entity */;
Entity target = /* optional target entity, or Entity.Null */;
IconPriority priority = IconPriority.High;
var notif = new Notification(source, target, priority);
// read values
var srcEntity = notif.entity;
var tgtEntity = notif.target;
var prio = notif.priority;
{{ Notes: - Because this is a readonly struct, it is safe to pass by value without risking accidental modification. - This type is meant to be used in ECS systems or UI code that displays/manage in-game notifications. - Ensure you include the appropriate assembly references for Unity.Entities and Game.Notifications when accessing these types from a mod. }}