Game.Tutorials.ControlSchemeActivationData
Assembly: Assembly-CSharp (may vary by build)
Namespace: Game.Tutorials
Type: struct
Base: IComponentData, IQueryTypeParameter
Summary:
Component used by the tutorial systems to request/represent activation of a specific input control scheme for an entity or context. It stores an InputManager.ControlScheme value (typically an enum) that systems can read to switch or check the active control scheme during tutorial steps. Being an IComponentData makes it a pure ECS data component; implementing IQueryTypeParameter indicates it is intended to be used in entity queries or query-related helpers.
Fields
public InputManager.ControlScheme m_ControlScheme
Holds the control scheme to activate (e.g., Keyboard+Mouse, Gamepad). Readers (tutorial systems or other game systems) should inspect this field to determine which control scheme to enable or present hints for.
Properties
- This type defines no properties. It exposes its data directly via the public field
m_ControlScheme
.
Constructors
public ControlSchemeActivationData(InputManager.ControlScheme controlScheme)
Initializes the struct with the provided control scheme value. Useful when creating or adding the component to an entity in one call.
Methods
- This type defines no methods. It's a simple data container intended to be consumed by systems.
Usage Example
// Create an entity and add the control scheme component to request activation of a scheme
var entity = entityManager.CreateEntity();
entityManager.AddComponentData(entity, new ControlSchemeActivationData(InputManager.ControlScheme.Gamepad));
// In a system you might read it like:
Entities
.ForEach((ref ControlSchemeActivationData activation) =>
{
// Example: switch input manager to the requested control scheme
InputManager.SetActiveControlScheme(activation.m_ControlScheme);
// Optionally remove the component if it's a one-shot request
// EntityManager.RemoveComponent<ControlSchemeActivationData>(entity);
}).Run();
Notes and tips: - Because this is an IComponentData struct it is cheap to add to entities and safe to use in jobs/systems as raw data. - Treat this as a one-shot or state marker depending on your tutorial flow: remove it after handling if you only needed a single activation event, or keep it to represent the currently-requested scheme. - InputManager.ControlScheme is expected to be an enum defined in Game.Input; consult that enum for available scheme values.