Exemple #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();
         }
     }
 }