This is a paid asset, but now you can download Touch Line Controller for FREE, but please remember this package is provided only for learning purposes or to be able to test before buying the product, NOT FOR COMMERCIAL PURPOSES.
Detail this asset from Unity Store: Original Link
Touch Line Controller v1.0
“If possible, please buy the package to support the developer”
Draw lines using mouse or touch input. The component captures all data points which then can be read.
Configure to optionally identify if trajectory intersects itself.
Easily extend to use custom type of lines by creating new materials or editing the line renderer properties.
This component includes prefabs and script for rendering based on input.