├── 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 | [](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 |
Vibrator.Vibrate(long milliseconds) | 19 |Will vibrate an android device for the specified number of milliseconds (1/1000th of a second). iOS will vibrate for a standard 500ms | 20 |
Vibrator.Vibrate(Vibration vibration) | 23 |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 | 30 |
Vibrator.Cancel() | 33 |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. | 34 |
Vibrator.IsAndroid() | 37 |Returns true of false depending on if the current device is Android or not. | 38 |
Feel free to use this is any of your projects without accreditation =) 40 | --------------------------------------------------------------------------------