Skip to Content

UnityInputAdapter

Service: Input (Input)
Code: Runtime/GnosisEngine/Adapters/Unity/Input/UnityInputAdapter.cs

Unity-side Rewired integration for GnosisInputService: joystick assignment, disconnect notifications, optional global pause from the Rewired System player, and per-frame UI navigation snapshots for UnityUserInterfaceAdapter.

Dependencies

  • Rewired — Expects ReInput ready (initializes in Awake / Start with fallbacks).
  • Place this component alongside the Rewired Input Manager and register it as the Input adapter on UnityGnosisEngine.

Behaviour (summary)

  • Manual joystick rules — Disables Rewired auto-assign where configured; assigns controllers to Player 1, Player 2, and System player ids (serialized).
  • Assignments — Builds an assignments snapshot and calls UpdateAssignments on the input service; publishes FACT_INPUT_ASSIGNMENTS_CHANGED when appropriate.
  • DisconnectsReInput.ControllerDisconnectedEventNotifyJoystickDisconnected.
  • Global pause — Optional: System player Pause action toggles engine run pause/resume (enableGlobalPauseToggle, action / map category fields).
  • UI navigation sample — Tracks mouse position and Rewired UI actions to populate _userInterfaceNavigationSnapshot consumed by the UI adapter for pointer vs gamepad routing.

Execution order

[DefaultExecutionOrder(-100)] — Runs early so input state is stable before much gameplay/UI.

Editor

UnityInputAdapterEditor — Inspector wiring under Editor/GnosisEngine/Permanent/Services/Input/.

See also

Last updated on