11000+款5星资源
8.5万+用户参与评分
10万+社区成员鼎力支持
每款资源都经过 Unity 审核
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.
Impulse Vibrations for iOS and Android (aka Haptic or Taptic Feedback)
