How to create a line with draw on c#?

Hi everyone! I want to write a c# code which will create a line when touched. This line should be linked with other objects. But I don’t have any idea how it’s create:(
like this

3 ways to draw 3D lines in Unity3D

Vectrosity