What’s in the asset ?
After importing the asset, and if you’re running v2.0 or more, you’ll get four folders, and it should look like this :
If that’s not the case and you don’t see that folder structure, you are probably running an old version of Nice Vibrations, in which case it’s recommended to update Unity to a more recent version (v2.0 is available for Unity 2019.2.9, and v3.0 starting with Unity 2019.3).
It’s strongly recommended to not remove anything from the contents of the asset, but if for some reason you feel like you have to, here’s a breakdown of each folder :
- Common contains all the scripts required to trigger haptic feedbacks on both Android and iOS. It is strongly recommended not to remove anything from this folder.
- Demos, as the name implies, contains the demo scenes that showcase the potential of the asset. In its Common folder you’ll find scripts used in most demos to handle the UI and other common features, in Old you’ll find the v1.x demo. It still works but has way less features than the 2.0 one. You can delete the whole Demos folder if you feel like you don’t need it, it’s completely optional.
- ThirdParty contains mostly one 3rd party API, used to parse AHAP files and turn them into Android Waveforms. If you’re not interested in that feature, you can remove that folder.
- OlderVersions contains previous versions of Nice Vibrations, just in case switching to the very latest doesn’t work for your project. That folder contains .unityPackages, that you can simply unpack into your project. If you decide to do so, of course, you’ll want to remove the latest version first.
Demos
Nice Vibrations comes with 7 demos (not counting the also included v1.x demo), showcasing the various options that Nice Vibrations enables when it comes to haptic feedback. You also get the complete code of these demos, so they’re also a nice opportunity to see the asset’s methods in action :
- Wobble : Tiny wobble pads that trigger a pre-configured advanced pattern when touched. Each also plays a differently pitched sound.
- Ball : A bouncing ball that triggers transient haptics of varying intensity and sharpness based on fall height.
- Continuous : This demo lets you trigger continuous haptics of the selected intensity, sharpness and duration. Once you’ve started a continuous haptic you can change its intensity and sharpness as it plays.
- Advanced Patterns : This expample lets you play with 9 different pre-created advanced patterns. These were designed to match their associated sounds.
- Transient : A transient haptic is a short, controlled haptic feedback that can be experimented with in this demo.
- Car : Turn the knob left and right and feel the car’s engine accelerate. Careful not to run out of gas!
- Base Presets : This one lets you experience the 9 different basic haptic patterns.
What’s the best way to update from an old version of the engine?
Remove the old NiceVibrations folder, and import the new one. If you don’t, due to the way the Asset Store importer works, some scripts may be duplicated, not removed, etc. Depending on what version you’re updating from, and what version you’re updating to, you may have some light refactoring to do. Make sure you check the release notes to see what changed and what may have an impact on your own code.