-
Notifications
You must be signed in to change notification settings - Fork 2
Vibration
Native free plugin for Unity for iOS and Android. Use custom vibrations on mobile.
Initialize the plugin with this line before using vibrations:
Vibration.Init();
Use Vibration.Vibrate();
for a classic default ~400ms vibration
Pop vibration: weak boom (For iOS: only available with the haptic engine. iPhone 6s minimum or Android)
Vibration.VibratePop();
Peek vibration: strong boom (For iOS: only available on iOS with the haptic engine. iPhone 6s minimum or Android)
Vibration.VibratePeek();
Nope vibration: series of three weak booms (For iOS: only available with the haptic engine. iPhone 6s minimum or Android)
Vibration.VibrateNope();
Vibration.Vibrate(500);
long [] pattern = { 0, 1000, 1000, 1000, 1000 };
Vibration.Vibrate ( pattern, -1 );
Vibration.Cancel();
vibration using haptic engine
Vibration.VibrateIOS(ImpactFeedbackStyle.Light);
Vibration.VibrateIOS(ImpactFeedbackStyle.Medium);
Vibration.VibrateIOS(ImpactFeedbackStyle.Heavy);
Vibration.VibrateIOS(ImpactFeedbackStyle.Rigid);
Vibration.VibrateIOS(ImpactFeedbackStyle.Soft);
Vibration.VibrateIOS(NotificationFeedbackStyle.Error);
Vibration.VibrateIOS(NotificationFeedbackStyle.Success);
Vibration.VibrateIOS(NotificationFeedbackStyle.Warning);
Vibration.VibrateIOS_SelectionChanged();