これまで
using UnityEngine;
public sealed class Example : MonoBehaviour
{
private void OnDrawGizmos()
{
Gizmos.DrawLine( new( 0, 0 ), new( 1, 0 ) );
Gizmos.DrawLine( new( 1, 0 ), new( 1, 1 ) );
Gizmos.DrawLine( new( 1, 1 ), new( 0, 1 ) );
Gizmos.DrawLine( new( 0, 1 ), new( 0, 0 ) );
}
}
新機能
using UnityEngine;
public sealed class Example : MonoBehaviour
{
private void OnDrawGizmos()
{
var points = new Vector3[]
{
new( 0, 0 ),
new( 1, 0 ),
new( 1, 0 ),
new( 1, 1 ),
new( 1, 1 ),
new( 0, 1 ),
new( 0, 1 ),
new( 0, 0 ),
};
Gizmos.DrawLineList( points );
}
}
using UnityEngine;
public sealed class Example : MonoBehaviour
{
private void OnDrawGizmos()
{
var points = new Vector3[]
{
new( 0, 0 ),
new( 1, 0 ),
new( 1, 1 ),
new( 0, 1 ),
};
Gizmos.DrawLineStrip( points, true );
}
}
参考サイト様