![](https://i-blog.csdnimg.cn/blog_migrate/12923d51ddb7b39130b8a9de4bedd0de.png)
![](https://i-blog.csdnimg.cn/blog_migrate/33013725f86b8a7d2a9bf2a007c98952.png)
![](https://i-blog.csdnimg.cn/blog_migrate/ede03397d838026a0d5a1e6036475718.png)
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System.Collections.Generic;
using UnityEngine;
//[ExecuteInEditMode]
public class DraveControl : MonoBehaviour {
Transform StartTrans;
public GameObject[] targetPos;
public int Speed;
Vector3 Center;
float Radius;
int CutIndex = 2;
Vector3 CenterObj;
Vector3 Direction;
bool isRot;
int NowIndex;
float Dot;
Vector3 startPos;
LineRenderer LR;
// Use this for initialization
void Start () {
StartTrans = this.transform;
startPos = StartTrans.position;
init();
// LR = this.GetComponent<LineRenderer>();//得到组件
// LR.SetVertexCount(targetPos.Length + 1);//设置线的段数
}
private void init()
{
Direc
public class DraveControl : MonoBehaviour {
Transform StartTrans;
public GameObject[] targetPos;
public int Speed;
Vector3 Center;
float Radius;
int CutIndex = 2;
Vector3 CenterObj;
Vector3 Direction;
bool isRot;
int NowIndex;
float Dot;
Vector3 startPos;
LineRenderer LR;
// Use this for initialization
void Start () {
StartTrans = this.transform;
startPos = StartTrans.position;
init();
// LR = this.GetComponent<LineRenderer>();//得到组件
// LR.SetVertexCount(targetPos.Length + 1);//设置线的段数
}
private void init()
{
Direc