Skip to Content

Platform UI

Shared, game-agnostic UI interaction service (input-mode domain), separate from game view/screen stack orchestration.

Service id: PlatformUI
Adapter (typical): UnityPlatformUIAdapter (project-level)

State

In-memory runtime state:

  • Current input mode (_inputMode), default mouseKeyboard

How it looks in persistent.json

None by default.
PlatformUI input mode state is runtime/in-memory and published via facts.

Events

Event ids are defined in GnosisPlatformUIEvents.

Event idWhen
FACT_PLATFORM_UI_INPUT_MODE_CHANGEDPlatform UI input mode changes (for example gamepad vs mouse/keyboard).

Functions

FunctionParametersResult
GetInputModeCurrent input mode string

Usage example — GetInputMode

PlatformUIService.Example1.cs
private string ReadPlatformInputMode() { if (Context?.Store == null || Context.CallService == null) return string.Empty; var empty = GnosisNode.CreateObject(Context.Store); var result = CallService("PlatformUI", "GetInputMode", empty); if (!result.Success || !result.Data.IsValid || result.Data.Type != GnosisValueType.String) return string.Empty; return (string)result.Data; }

C# API

SetInputMode(string mode) — adapter-facing API that updates runtime mode and publishes FACT_PLATFORM_UI_INPUT_MODE_CHANGED.

Statistics

None.

See also

Last updated on