This template includes a lightweight Vibration System that provides haptic feedback across supported platforms. The system is designed to be simple, extensible, and accessible from any part of the project via dependency injection.
Supported Platforms
Android
IOS
Note: Actual vibration behavior may vary depending on the device and OS version.
Registration and Dependency Injection
The vibration functionality is implemented in the Vibration class.
An instance of Vibration is created during game initialization in the GameInstaller and bound to the ProjectContext container. This makes the service globally available throughout the project.
Container.Bind<Vibration>().AsSingle();
The dependency is injected via constructor injection, for example: