Game.Prefabs.StrictObjectBuiltRequirementData
Assembly:
Game (may also appear in Assembly-CSharp depending on build)
Namespace:
Game.Prefabs
Type:
struct StrictObjectBuiltRequirementData
Base:
IComponentData, IQueryTypeParameter
Summary:
Represents a strict "object built" requirement used by prefabs or gameplay systems to express that a specific Entity (object/prefab) must be built at least a given number of times. This is a plain ECS value-type component that stores a reference to the required object entity and the minimum count required. Because it implements IQueryTypeParameter it can be used directly in entity queries where appropriate.
Fields
-
public Entity m_Requirement
Entity reference to the required object/prefab that this requirement refers to. Typically this will be the entity representing the object/prefab that must be built. -
public int m_MinimumCount
Minimum number of instances of m_Requirement that must be built to satisfy this requirement. Use a non-negative integer; 0 means no instances required.
Properties
- (none)
This struct exposes public fields and does not define properties. Access and mutation are done via the fields.
Constructors
- (implicit default)
public StrictObjectBuiltRequirementData()
Value-type default constructor provided by C#. Initializes m_Requirement to Entity.Null and m_MinimumCount to 0. You can create and initialize an instance using an object initializer.
Methods
- (none)
This type defines no methods. It's a simple data container used as an ECS component / query parameter.
Usage Example
// Create a requirement that 3 instances of `requiredEntity` must be built
var requirement = new StrictObjectBuiltRequirementData {
m_Requirement = requiredEntity,
m_MinimumCount = 3
};
// Add the component to an entity (e.g., a prefab or requirement-tracking entity)
entityManager.AddComponentData(targetEntity, requirement);
// Or update an existing component
entityManager.SetComponentData(targetEntity, requirement);
Additional notes: - Because this is an IComponentData, it should be added/removed/queried through the EntityManager / SystemBase ECS APIs. - The m_ prefix follows the project's field naming convention; treat fields as the serialized/runtime data for the component.