// 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(); } } }
// Start is called before the first frame update void Start() { currentPoint = GetNewPoint(); currentPoint.StartVFX(); }