Gameptics 1.0.0
Gameptics (Game+Haptics) is a lightweight cross-platform haptics toolkit for Unity. Author haptic signals and sequences with duration, intensity and sharpness, then play them on iOS and Android.
Loading...
Searching...
No Matches
SCG.Gameptics.GamepticManager Class Referencesealed

Provides a single entry point for triggering haptic feedback. Owns enabled state, cooldown, cancellation policy, and backend selection. Creates an instance automatically when first accessed via Instance. More...

Inheritance diagram for SCG.Gameptics.GamepticManager:

Public Member Functions

bool CanPlayNow ()
 Returns true when haptics are enabled, backend support is available, and cooldown has expired.
void Play (GamepticPresetId preset)
 Plays a predefined preset resolved by GamepticPresets. Presets are returned as new instances and can be modified by the caller. Playback respects cooldown, enabled state, and cancellation settings.
void Play (GamepticPresetId preset, Action onComplete)
 Plays a predefined preset resolved by GamepticPresets and calls onComplete when finished.
void Play (GamepticSignal signal)
 Plays a single haptic signal using the active backend. If a previous playback is active, it may be canceled depending on settings. Playback respects cooldown and the global enabled toggle.
void Play (GamepticSignal signal, Action onComplete)
 Plays a single haptic signal using the active backend and invokes onComplete after its duration elapses.
void Play (GamepticSequence sequence)
 Plays a haptic sequence in order using realtime delays. If a previous playback is active, it may be canceled depending on settings. Playback respects cooldown and the global enabled toggle.
void Play (GamepticSequence sequence, Action onComplete)
 Plays a haptic sequence in order and invokes onComplete when the sequence finishes.
void Stop ()
 Stops the current playback if any. Cancels sequence coroutines and calls backend stop when supported. This is safe to call when nothing is playing.

Static Public Member Functions

static void PlayPreset (GamepticPresetId preset)
static void PlayPreset (GamepticPresetId preset, Action onComplete)
static void PlaySignal (GamepticSignal preset)
static void PlaySignal (GamepticSignal preset, Action onComplete)
static void PlaySequence (GamepticSequence preset)
static void PlaySequence (GamepticSequence preset, Action onComplete)
static void StopPlayback ()

Properties

GamepticManagerSettings Settings = new() [get]
 Global settings controlling haptic playback.
static GamepticManager Instance [get]
 Gets the global GamepticManager instance. If no instance exists, a new GameObject is created and the component is added. The created instance persists across scene loads.
bool IsEnabled [get, set]
 Gets or sets whether haptics are enabled globally. When persistence is enabled in settings, the state is stored in PlayerPrefs. When persistence is disabled, the state is stored only in memory.

Detailed Description

Provides a single entry point for triggering haptic feedback. Owns enabled state, cooldown, cancellation policy, and backend selection. Creates an instance automatically when first accessed via Instance.


The documentation for this class was generated from the following file:
  • SCG/Gameptics/Core/GamepticManager.cs