Skip to Content

UnityGnosisAdapter (base)

Code: Runtime/GnosisEngine/Adapters/Unity/UnityGnosisAdapter.cs

Abstract MonoBehaviour base for all first-party Unity adapters. Core services stay Unity-free; adapters hold IGnosisService and forward calls or subscribe to the event bus.

Binding

  • BindService(IGnosisService) — Called by UnityGnosisEngine when wiring the service list. If the service is a GnosisServiceBase with CommunicationPolicy.AllowUnityAdapters == false, binding is refused (service cleared, error logged). Internal / tooling-only services are not adapter-bound this way.
  • OnServiceBound() — Override to hook UI, subscribe to events, or read initial state after a successful bind.

Invoking functions from Unity

  • Invoke(string name, GnosisNode parameters) — Forwards to Service.InvokeFunction. Use when Unity code needs the same surface as CallService on the host.
  • Invoke(string name) — Parameterless overload.

Derived adapters often also subscribe to UnityGnosisEngine.Instance.EventBus and implement playback or UI without going through Invoke for every frame.

See also

Last updated on