Game.Prefabs.ForceUnlockRequirementData
Assembly: Assembly-CSharp (game/runtime assembly)
Namespace: Game.Prefabs
Type: struct
Base: IComponentData, IQueryTypeParameter
Summary:
A lightweight ECS component used to declare that a specific prefab (referenced by an Entity) is a requirement for a "force unlock" condition. It stores a single Entity reference to the prefab that must be considered for unlocking logic. Implementing IComponentData makes it attachable to entities; IQueryTypeParameter indicates it can be used as a query parameter type in Unity.Entities queries for filtering or processing.
Fields
public Entity m_Prefab
Holds the Entity reference to the prefab that is the target/requirement for the force-unlock check. This is the only data this component carries; it is expected to reference a prefab entity elsewhere in the ECS world.
Properties
- This type has no properties.
Constructors
public ForceUnlockRequirementData()
No explicit constructors are defined. As a value type (struct), it has the default parameterless constructor provided by .NET which initializes m_Prefab to Entity.Null.
Methods
- This type defines no methods.
Usage Example
// Example: attach the requirement to an entity so systems can detect the required prefab.
using Unity.Entities;
using Game.Prefabs;
public void AddForceUnlockRequirement(EntityManager entityManager, Entity ownerEntity, Entity requiredPrefab)
{
var requirement = new ForceUnlockRequirementData { m_Prefab = requiredPrefab };
entityManager.AddComponentData(ownerEntity, requirement);
}
Notes: - Typically used by systems that check whether a given prefab is present/unlocked and then perform "force unlock" logic. - Because it implements IQueryTypeParameter, it can be used in query filters or as part of typed queries to locate relevant entities quickly.