draw line api unity code example
Example 1: unity gizmo draw line
using UnityEngine;
using System.Collections;public class ExampleClass : MonoBehaviour
{
public Transform target; void OnDrawGizmosSelected()
{
if (target != null)
{
Gizmos.color = Color.blue;
Gizmos.DrawLine(transform.position, target.position);
}
}
}
Example 2: unity drawline
public Transform target;
void OnDrawGizmosSelected()
{
if (target != null)
{
Gizmos.color = Color.blue;
Gizmos.DrawLine(transform.position, target.position);
}
}