Impulse Vibrations for iOS and Android (aka Haptic or Taptic Feedback)
Publisher | HyperFlex Digital |
---|---|
File size | 107.38kB |
Number of files | 16 |
Latest version | 1 |
Latest release date | 2021-01-05 11:44:12 |
First release date | 2021-01-05 11:44:12 |
Supported Unity versions | 2018.4.2 or higher |
Impulse Vibrations for iOS and Android (aka Taptic or Haptic Engine)
Impulse Vibrations is providing bridging between mobile haptic vibration API's and Unity3D Engine. Basically, it's an wrapper around UIFeedbackGenerator [iOS], Vibrator [Android], and View#performHapticFeedback() [Android].
Unlike most of the other Unity plugins, this will not provide you a common interface for each platform. Yet, it will give you more control over the code as a developer!
OS/Device Support
- Support iOS 10+ starting from iPhone 7 to the latest model/OS
- Supports all Android versions
Features
- Example Unity scene to test the API.
- Has safe to use API, it checks the OS versions and fallbacks in some cases.
- It has one line easy to use integration.
- iOS Taptic Engine support with `UIFeedbackGenerator` class.
- Android `Vibrator` class support.
- Android `View#performHapticFeedback()` class support for starting from SDK level 26.
- API documentation and Comments above the functions
- All of the source code included, so it's open for extend.
iOS API
- UISelectionFeedbackGenerator
- UIImpactFeedbackGenerator (light, medium, heavy, rigid, soft)
- UINotificationFeedbackGenerator (success, warning, error)
Android API
- HapticFeedbackConstants
- Vibrate with VibrationEffect (long milliseconds, int amplitude = -1)
Important Note
- Don't forget to add the `using ImpulseVibrations;` line on the top of your class.
- Some Android devices doesn't support all of the Haptic Feedbacks.
- Taptic Engine and Vibrations will only work on the physical device. So consider the test this feature on the real device instead of Unity Editor.