Input
Logical input: assignment snapshot, UI navigation sample per frame, and semantic actions from JSON config. No direct Unity/Rewired types in the core.
Adapter: UnityInputAdapter (game-specific implementation reports hardware).
State / config
| Source | Purpose |
|---|---|
In-memory _assignments | Latest assignments object from adapter |
_userInterfaceNavigationSnapshot | Latest UI nav intents for UnityUserInterfaceAdapter |
Persistent.configuration.inputs | Action definitions for EmitAction |
How it looks in persistent.json
inputs is merged under Persistent.configuration when your Configuration packs load. Shape is game-defined; each action is usually an object keyed by actionId (or nested — follow your configuration.json / index files).
persistent.json
{
"Persistent": {
"configuration": {
"inputs": {
"pause": {
"actionId": "pause",
"category": "ui",
"valueType": "button",
"targetEvent": "GAME_PAUSE_REQUEST"
}
}
}
}
}Events
Fixed string ids are implemented in GnosisInputService (Runtime/GnosisEngine/Source/Services/Persistent/Services/Input/). EmitAction may also publish a per-action targetEvent string from Persistent.configuration.inputs (not listed here).
| Event id | Role |
|---|---|
FACT_INPUT_ASSIGNMENTS_CHANGED | After UpdateAssignments |
FACT_INPUT_JOYSTICK_DISCONNECTED | Adapter reports disconnect |
REQUEST_INPUT_ACTION | Emitted by EmitAction; interceptable |
FACT_INPUT_ACTION_PROCESSED | After action allowed and optional targetEvent dispatch |
Functions
| Function | Parameters | Behavior |
|---|---|---|
GetAssignments | — | Current assignments object |
UpdateAssignments | assignments object or { assignments: {...} } | Stores snapshot, publishes assignments changed |
NotifyJoystickDisconnected | object payload | Forwards event |
GetActions | — | configuration.inputs object |
EmitAction | actionId (required), optional playerId, phase/value fields | Loads action config, publishes REQUEST_INPUT_ACTION, may dispatch targetEvent, then FACT_INPUT_ACTION_PROCESSED |
Usage example — EmitAction
InputService.Example1.cs
private void EmitPauseAction()
{
if (Context?.Store == null || Context.CallService == null)
return;
var args = GnosisNode.CreateObject(Context.Store);
args.Set("actionId", "pause");
CallService("Input", "EmitAction", args);
}Statistics
None.
Last updated on