示例#1
0
 // Update is called once per frame
 void Update()
 {
     if (currentPoint == null)
     {
         return;
     }
     Debug.DrawLine(player.transform.position, currentPoint.transform.position, Color.blue);
     if (Vector3.Distance(player.transform.position, currentPoint.transform.position) < pointSize)
     {
         allPoints.Remove(currentPoint);
         currentPoint.StopVFX();
         if (allPoints.Count == 0)
         {
             currentPoint = null;
             Debug.Log("complete");
         }
         else
         {
             Debug.Log("new point");
             currentPoint = GetNewPoint();
             currentPoint.StartVFX();
         }
     }
 }
示例#2
0
 // Start is called before the first frame update
 void Start()
 {
     currentPoint = GetNewPoint();
     currentPoint.StartVFX();
 }