Game.SubObjectsUpdated
Assembly:
Assembly-CSharp (typical for Cities: Skylines 2 mods)
Namespace:
Game.Objects
Type:
struct
Base:
Implements: Unity.Entities.IComponentData, Unity.Entities.IQueryTypeParameter
Summary:
Lightweight ECS component that carries a reference to an owning Entity. Intended to mark or signal that sub-objects of the specified owner entity were updated, so systems can detect and react to those updates. Because it implements IComponentData it can be added as component data to entities; implementing IQueryTypeParameter indicates it is intended to be used in queries/type-based APIs in Unity.Entities.
Fields
public Unity.Entities.Entity m_Owner
Holds the Entity that owns the updated sub-objects. Systems that process this component will typically read this field to determine which entity's sub-objects need handling.
Properties
- (none)
This struct exposes no properties.
Constructors
public SubObjectsUpdated(Unity.Entities.Entity owner)
Constructs the component and sets the m_Owner field to the provided Entity. Use this to create an instance to add to an entity via the EntityManager or an Entities API.
Methods
- (none)
The struct contains no methods beyond the constructor and only serves as a data container / tag component.
Usage Example
// Example: creating and adding the component to an entity
var updated = new SubObjectsUpdated(ownerEntity);
entityManager.AddComponentData(someEntity, updated);
// Example: removing the marker after handling in a system
if (entityManager.HasComponent<SubObjectsUpdated>(someEntity))
{
var marker = entityManager.GetComponentData<SubObjectsUpdated>(someEntity);
// process marker.m_Owner as needed...
entityManager.RemoveComponent<SubObjectsUpdated>(someEntity);
}
Additional notes: - Because this is a POD struct used as a component, prefer creating and removing instances via the ECS APIs (EntityManager or SystemBase/ComponentSystem methods) rather than storing long-lived references. - Use in queries: systems can query for entities carrying SubObjectsUpdated to batch-handle sub-object updates for owners.