├── Comp3Interactive Vibration.unitypackage └── README.md /Comp3Interactive Vibration.unitypackage: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Comp3interactive/Unity-Vibrator/c0fe1c366fbeb7484136952955610b548c8e293e/Comp3Interactive Vibration.unitypackage -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Unity-Vibrator 2 | 3 | [![Codacy Badge](https://api.codacy.com/project/badge/Grade/f70a74f2ca5840e6b6e923012fe74d47)](https://app.codacy.com/manual/Comp3interactive/Unity-Vibrator?utm_source=github.com&utm_medium=referral&utm_content=Comp3interactive/Unity-Vibrator&utm_campaign=Badge_Grade_Dashboard) 4 | 5 | Performs custom Vibrate functions on an Android device and standard vibrations on iOS 6 | 7 | Overview
8 | This Unity Package will provide you with simple functions to call as and when you require a mobile device to vibrate.
9 | Android allows for customisable lengths whereas iOS will perform a standard 500ms vibration.

10 | Simply have the package inside your project and everything is ready to go! 11 | 12 | Public Methods
13 | public static void Vibrate(long milliseconds) { ... }
14 | public static void Vibrate(Vibration vibration) { ... }
15 | public static void Cancel() { ... }
16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 |
Vibrator.Vibrate(long milliseconds)Will vibrate an android device for the specified number of milliseconds (1/1000th of a second). iOS will vibrate for a standard 500ms
Vibrator.Vibrate(Vibration vibration)Will vibrate an android device for one of the pre-set vibration lengths in the Vibration enum. Values are as follows:
24 | SHORT = 100ms
25 | MEDIUM = 250ms
26 | LONG = 500ms
27 | VERY_LONG = 1000ms

28 | 29 | iOS will, again, only vibrate for a standard 500ms
Vibrator.Cancel()Will cancel any active vibration performing on the device. This method will only work on Android devices, iOS will not respond to this method call.
Vibrator.IsAndroid()Returns true of false depending on if the current device is Android or not.
39 |

Feel free to use this is any of your projects without accreditation =) 40 | --------------------------------------------------------------------------------