Game.Tutorials.UIActivationData
Assembly:
Assembly-CSharp
Namespace:
Game.Tutorials
Type:
struct
Base:
Implements Unity.Entities.IComponentData, Unity.Entities.IQueryTypeParameter
Summary:
A simple ECS component used to mark UI activation state for tutorial-related UI elements. It carries a single boolean that signals whether the UI element is allowed to be deactivated. Intended for use with Unity DOTS (Entities) workflows in mod systems or game code that manage tutorial UI lifecycle.
Fields
public System.Boolean m_CanDeactivate
Indicates whether the associated UI element can be deactivated (true) or must remain active (false). Stored directly on the component as a public field to keep the struct lightweight for DOTS usage.
Properties
- (none)
This struct exposes no properties; it uses a public field for data access to be efficient in ECS contexts.
Constructors
public UIActivationData(bool canDeactivate)
Creates a new UIActivationData instance with the given deactivation flag.- Parameter:
canDeactivate
— If true, the UI element may be deactivated; if false, it should remain active.
Methods
- (none)
This value type does not define methods. It is intended purely as data for ECS queries and systems.
Usage Example
// Add the component to an entity (Entities API / EntityManager)
var uiActivation = new UIActivationData(canDeactivate: true);
entityManager.AddComponentData(myUiEntity, uiActivation);
// In a system, read the flag via a component lookup or in a query:
// Example (pseudo-code for a SystemBase):
Entities
.WithAll<UITag>() // hypothetical tag identifying UI entities
.ForEach((ref UIActivationData activation) =>
{
if (activation.m_CanDeactivate)
{
// perform deactivation logic
}
}).Schedule();