Game.Prefabs.TutorialInputTriggerPrefab
Assembly: Assembly-CSharp
Namespace: Game.Prefabs
Type: class
Base: TutorialTriggerPrefabBase
Summary:
Prefab class used by the game's tutorial system to define input-based triggers. It exposes an array of InputAction entries (map + action name) which are used to determine which input events should fire the associated tutorial trigger. When collecting prefab components it ensures the runtime entity contains an InputTriggerData component (read/write).
Fields
-
public InputAction[] m_Actions
Array of InputAction entries. Each entry identifies an input map and an action name that the tutorial trigger should listen for. Typically populated in the editor on the prefab to specify which input(s) will activate the trigger. -
public struct InputAction
Container struct used to pair an input map name with an action name. -
public string m_Map
Name of the input map (e.g., a control scheme or grouping defined in the input system). -
public string m_Action
Name of the action within the input map to listen for (e.g., "Select", "Confirm", "BuildModeToggle").
Properties
- None
Constructors
public TutorialInputTriggerPrefab()
Default constructor. Instances are typically created/managed by Unity (as part of prefab assets); no special initialization logic is defined in this class.
Methods
public override void GetPrefabComponents(HashSet<ComponentType> components)
Collects the set of ECS component types that the prefab will add to a spawned entity. This override calls the base implementation and then adds a read/write InputTriggerData component type to the provided set so the runtime entity will contain the data needed to evaluate input-based tutorial triggers.
Usage Example
// Example: programmatically create/configure a prefab instance and collect its ECS component types
var prefab = new Game.Prefabs.TutorialInputTriggerPrefab();
prefab.m_Actions = new[]
{
new Game.Prefabs.TutorialInputTriggerPrefab.InputAction { m_Map = "KeyboardAndMouse", m_Action = "Confirm" },
new Game.Prefabs.TutorialInputTriggerPrefab.InputAction { m_Map = "Gamepad", m_Action = "AButton" }
};
var components = new HashSet<Unity.Entities.ComponentType>();
prefab.GetPrefabComponents(components);
// components now contains InputTriggerData (ReadWrite) in addition to any base prefab components
Notes: - The m_Map and m_Action string values must match names defined in the game's input configuration so the trigger can correctly identify input events. - This prefab only declares which components will be present on the resulting entity; runtime behavior for listening to input and firing tutorial events is handled by systems that read InputTriggerData.