Hi,
I’d like to use the regular draw commands both in game and in edit mode, similar to how you can with regular Debug.DrawLine.
It works, but it flickers, I’m assuming because the Update method is not called as frequently in edit mode. Is there a way?
[ExecuteAlways]
public class AlineTester : MonoBehaviour
{
public Transform from;
public Transform to;
[ColorUsage(true, true)]
public Color color = Color.red;
[ExecuteInEditMode]
void Update () {
var position2 = to.position;
var position1 = from.position;
Debug.DrawLine(position1, position2, color); // works
Draw.Line(position1, position2, color); // works but flickers
}
}