Skip to content

Instantly share code, notes, and snippets.

@antoinefortin
Created December 13, 2021 05:55
Show Gist options
  • Save antoinefortin/f86375abf8407ffa29b60b0a4c25c4d5 to your computer and use it in GitHub Desktop.
Save antoinefortin/f86375abf8407ffa29b60b0a4c25c4d5 to your computer and use it in GitHub Desktop.
void OnDrawGizmosSelected()
{
Gizmos.color = Color.red;
listVert[0] = vert0;
listVert[1] = vert1;
listVert[2] = vert2;
for (int i = 0; i < listVert.Length; i++)
{
Gizmos.DrawCube(listVert[i], new Vector3(1.0f, 1.0f, 1.0f));
// Draw line between Verts
if (i == (listVert.Length - 1))
{
Gizmos.DrawLine(listVert[i], listVert[0]);
}
else
{
Gizmos.DrawLine(listVert[i], listVert[i + 1]);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment