用于绘制一条固定路线
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
namespace FGUFW.Core
{
public class DrawLine : MonoBehaviour
{
public List<Vector3> Path=new List<Vector3>{};
public Vector3 Offset;
public Color color=Color.green;
#if UNITY_EDITOR
public DrawLineMode Mode;
[Header("Point模式时采点的最小间距")]
public float MinDistance=10;
/// <summary>
/// Callback to draw gizmos that are pickable and always drawn.
/// </summary>
void OnDrawGizmos()
{
Gizmos.color=color;
for (int i = 1; i < Path.Count; i++)
{
Vector3 s = this[i-1];
Vector3 e = this[i];
Gizmos.DrawLine(s,e);
}
}
#endif
public Vector3 this[int i] => Pat