Game.Tutorials.AdvisorActivationData
Assembly: Assembly-CSharp
{{ This type is defined in the game's main managed assembly (commonly "Assembly-CSharp"). The exact assembly name may vary depending on how the mod or project is organized. }}
Namespace: Game.Tutorials
Type: struct
Base: System.ValueType
{{ Implements: Unity.Entities.IComponentData, Unity.Entities.IQueryTypeParameter — this is an ECS "tag" component type. }}
Summary:
{{ AdvisorActivationData is an empty (tag) ECS component used to mark or flag entities related to advisor/tutorial activation logic. It contains no payload; the attribute [StructLayout(LayoutKind.Sequential, Size = 1)] ensures the struct occupies at least one byte so it can be used as a component in Unity's ECS safely. Typical usage is to add or remove this component from entities to indicate that the advisor should be activated or that an entity participates in advisor-related queries. }}
Fields
-
This struct defines no instance fields.
{{ It is intentionally empty; treated as a tag component. The StructLayout/Size(1) is used to avoid zero-size issues in some native/component storage implementations. }} -
(none)
Properties
- This type defines no properties.
{{ As a pure tag IComponentData, it has no stateful properties. }}
Constructors
- The type uses the implicit default parameterless constructor.
{{ Because it is an empty value type, no user-defined constructors are present. The runtime provides a default constructor that yields the zeroed state (unused here). }}
Methods
- This type defines no methods.
{{ Behavior is implemented by systems that add/remove or query for this component; the component itself carries no logic. }}
Usage Example
// Add the tag to an entity to mark it for advisor activation:
entityManager.AddComponent<AdvisorActivationData>(someEntity);
// Remove the tag to clear the activation marker:
entityManager.RemoveComponent<AdvisorActivationData>(someEntity);
// Query systems can filter by the tag:
Entities
.WithAll<AdvisorActivationData>()
.ForEach((Entity entity, in SomeOtherComponent comp) =>
{
// perform advisor activation logic for this entity
})
.Schedule();
// Alternatively, check presence and add/remove conditionally in a system:
protected override void OnUpdate()
{
Entities.ForEach((Entity e, ref PlayerState state) =>
{
if (ShouldActivateAdvisor(state) && !EntityManager.HasComponent<AdvisorActivationData>(e))
{
EntityManager.AddComponent<AdvisorActivationData>(e);
}
else if (!ShouldActivateAdvisor(state) && EntityManager.HasComponent<AdvisorActivationData>(e))
{
EntityManager.RemoveComponent<AdvisorActivationData>(e);
}
}).Schedule();
}
{{ Notes: Use this struct when you need a lightweight marker for systems to detect or act on advisor/tutorial activation without carrying additional data. The IQueryTypeParameter interface indicates it can be used conveniently in query construction patterns. }}