Skip to content

Game.DevTreeNodeAutoUnlock

Assembly:
Game (assembly containing Game.Prefabs)

Namespace:
Game.Prefabs

Type:
struct

Base:
System.ValueType
Implements: IComponentData, IQueryTypeParameter

Summary:
DevTreeNodeAutoUnlock is an empty "tag" ECS component (IComponentData) used to mark an entity so that the corresponding development tree node should be automatically unlocked. The struct is given an explicit layout/size ([StructLayout(LayoutKind.Sequential, Size = 1)]) to ensure it occupies at least one byte (avoiding zero-sized type behavior) and to make it safe/consistent when used in native/interop or low-level ECS operations.


Fields

  • This type defines no managed fields. It is an empty/tag component.

Properties

  • This type defines no properties.

Constructors

  • public DevTreeNodeAutoUnlock()
    The default parameterless constructor exists implicitly for the struct. You normally create the component by using the implicit default like new DevTreeNodeAutoUnlock() when adding it to an entity.

Methods

  • This type defines no methods. It is purely a marker component intended for queries and matching.

Usage Example

// Add the tag to an existing entity:
entityManager.AddComponentData(entity, new DevTreeNodeAutoUnlock());

// Create an archetype that includes the auto-unlock tag:
var archetype = entityManager.CreateArchetype(
    typeof(DevTreeNodeAutoUnlock),
    /* other component types */
);

// Querying for entities that have this tag (in a SystemBase):
protected override void OnUpdate()
{
    Entities
        .WithAll<DevTreeNodeAutoUnlock>()
        .ForEach((Entity e) =>
        {
            // Handle auto-unlock logic here
        }).Schedule();
}

// Alternatively obtain an EntityQuery:
var query = GetEntityQuery(ComponentType.ReadOnly<DevTreeNodeAutoUnlock>());
var entities = query.ToEntityArray(Allocator.TempJob);

Notes: - Because this is a tag component, systems should check for its presence (WithAll / WithNone / HasComponent) rather than relying on data stored in the component. - The StructLayout(Size = 1) attribute ensures the component has non-zero size which can help compatibility with certain native or serialization expectations.