Drawing lines in editor without running the game?
Is this even possible? I have a script that generates waypoints on my terrain and I want to see all the connections between the waypoints so I can move them around and edit links as I see fit, but I do not want these lines to be visible in the game at all. Is there a current solution that will work? Each waypoint has a list of all the waypoints it is connected to as well. I prefer to do this without running the game since everything tends to reset back if you move things around one you stop the game.
NOTE: I am using unity 5.1.3f1 because 5.2.x broke V's terrain hole system.
Answer by cod · Sep 18, 2015 at 08:18 AM
You might want to use the linerenderer class http://docs.unity3d.com/ScriptReference/LineRenderer.html and use the function LineRenderer.SetPosition to store all waypoints, so that you can be able to see a line joining them http://docs.unity3d.com/ScriptReference/LineRenderer.SetPosition.html
Then at runtime you could disable the LineRenderer component in order to hide it
That looks like it could work. I kept googling and came across gizmos which indeed did what I wanted as well (at first I thought it was another asset I was going to end up paying for, but apparently it is part of Unity.) Your answer does have the upside of always showing the mesh ins$$anonymous$$d of group selecting all of my waypoints (4001) and if it updates as I move them around I will probably use this solution ins$$anonymous$$d.
Your answer
Follow this Question
Related Questions
How do i Gizmos.drawLines in an order?? 2 Answers
Is it possible to add a sprite-picker in a custom Editor Window? 1 Answer
How to change the color of a GL line? 0 Answers
MY buttons don't show up 0 Answers
Progress Bar w/ sprite placement help 0 Answers