- Home /
The question is answered, right answer was accepted
C# script who draw a line in EditMode
Hi,
Someone knows how an script (component of many gameobjects) can draw a line in the scene window in editmode ? This script have a public class (MonoBehaviour herited) and must access his public variables (like Range, float, ... alterable in the inspector) !
In fact, each instantiation of this script should draw his own line (like the Collider2D component)..
I did not found the solution on Google after more two hours... Sorry for my possibly bad English, I'm french. Thanks for your replies !
EDIT: Solution :
void OnDrawGizmos()
{
Gizmos.DrawLine (Start, End);
}
Ok thanks, it's that true, my problem was I have tested many things and when I tried this, I did not see the results because I've used a private variable in the gizmos. Thanks a lot my friend ;)