Hat catching ball - Unity3D - source code and detailed documentation