void Update() { angularSpeed = (SimpleClock.BeatLength() * 2); if (rotating) { child.transform.localPosition = PointOnCircle(rotationTime * ((2 * Mathf.PI) / angularSpeed)) * radius; rotationTime += Time.deltaTime; } }
public IEnumerator WaitAndMove(float delayTime) { currTime = 0f; // SetMaterial(true); SetVisibility(true); while (currTime < (SimpleClock.MeasureLength() * 4 - (SimpleClock.BeatLength() / 2))) { // until one second passed currTime += Time.deltaTime; transform.position = Vector3.Lerp(startPos, destinationPos, currTime / (SimpleClock.MeasureLength() * 4)); // lerp from A to B in currTime/(SimpleClock.MeasureLength() * 4 glowScript.GlowBrightness = Mathf.Lerp(1f, 3.5f, currTime / (SimpleClock.MeasureLength() * 4)); //notes get brighter as they approach the fret yield return(1); // wait for next frame } //make a note invisible once it has reached its destination ResetNote(false, true); }