Skip to Content

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

SourcePurpose
In-memory _assignmentsLatest assignments object from adapter
_userInterfaceNavigationSnapshotLatest UI nav intents for UnityUserInterfaceAdapter
Persistent.configuration.inputsAction 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 idRole
FACT_INPUT_ASSIGNMENTS_CHANGEDAfter UpdateAssignments
FACT_INPUT_JOYSTICK_DISCONNECTEDAdapter reports disconnect
REQUEST_INPUT_ACTIONEmitted by EmitAction; interceptable
FACT_INPUT_ACTION_PROCESSEDAfter action allowed and optional targetEvent dispatch

Functions

FunctionParametersBehavior
GetAssignmentsCurrent assignments object
UpdateAssignmentsassignments object or { assignments: {...} }Stores snapshot, publishes assignments changed
NotifyJoystickDisconnectedobject payloadForwards event
GetActionsconfiguration.inputs object
EmitActionactionId (required), optional playerId, phase/value fieldsLoads 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