IEnumerator ChangeShape(Vector3[] newShape, LINE line, float Seconds) { cycling = true;//technically this isnt the best way to handle cycling. float StartTime = Time.time; for (int i = 0; i < line.offset; i++) { Cycle(newShape); } while (Time.time - StartTime < Seconds) { if (cycle) { line.Cycle(); Cycle(newShape); } for (int i = 0; i < 128; i++) { line.points[i] = Vector3.Lerp(line.points[i], newShape[i], (Time.time - StartTime) / (Seconds + Time.time - StartTime) / Seconds / 3); } line.SetPositions(); yield return(null); } line.points = newShape; line.SetPositions(); cycling = false; }
public void Update() { if (cycle & !cycling) { terminal.Cycle(); origin.Cycle(); } }