The code is the result of this video tutorial series (german): https://www.youtube.com/watch?v=R0IjsLIkf2g&list=PL8XNf8lax18m-RGjWivOpAqaFBqHDQ-X_
Maybe it's already a bit improved ot the original code from the video.
Initialy it was created for Unity 5.4 but most likely it will work also for further versions.
If you can help or improve the script, just fork it and create some pull requests.
If you like to buy some coffee, i will appriciate it. You can do this on Patreon or via PayPal