Skip to Content

UnityHapticAdapter

Service: Haptic (Haptic)
Code: Runtime/GnosisEngine/Adapters/Unity/Haptic/UnityHapticAdapter.cs

Subscribes to GnosisHapticEvents request ids on UnityGnosisEngine.Instance.EventBus and drives Lofelt Nice Vibrations (HapticPatterns) on device. The Haptic service remains logical; this adapter is hardware.

Events consumed

Matches the service’s request events, including REQUEST_HAPTIC_PLAY_PRESET, REQUEST_HAPTIC_PLAY_EMPHASIS, REQUEST_HAPTIC_PLAY_CONSTANT, REQUEST_HAPTIC_PLAY_CLIP, REQUEST_HAPTIC_PLAY_PIECE_FEEDBACK, REQUEST_HAPTIC_STOP_ALL. Payload keys align with GnosisHapticEvents.PAYLOAD_*.

Presets — Parsed to HapticPatterns.PresetType. Unknown preset names log a warning.

Piece feedbackTryPlayPolydropPieceFeedback for game-specific kinds (Move, Rotate, HardDrop, …).

Gate / settings

On bind and before playing, syncs Nice Vibrations enable state from the haptic service (respects hapticsEnabled / service policy).

Singleton

Instance — Enforced in Awake (duplicate destroyed). Useful for other Unity code that must locate the adapter; prefer host wiring for new code.

Editor

UnityHapticAdapterEditor under Editor/GnosisEngine/Permanent/Services/Haptic/.

See also

Last updated on