public void AddNote(int i) { Debug.Log("Add Bird Note"); int count = notes.Count + 1; float dist = math.GetDistance(); int j = 0; foreach (GameObject note in notes) { float distance = dist / count * j; Vector3 position = math.CalcPositionByDistance(distance); s.Append(note.transform.DOMove(new Vector3(position.x, position.y * Random.Range(0.8f, 1.2f)), 2f)); j++; } float newdist = dist / count * j; Vector3 newPos = math.CalcPositionByDistance(newdist); newPos = new Vector3(newPos.x, newPos.y * Random.Range(0.8f, 1.2f), newPos.z); GameObject obj = Instantiate(notePrefabs[i], newPos, Quaternion.identity); obj.transform.localScale *= Mathf.Pow(1.1f, count); notes.Add(obj); }
void Update() { Vector2 TargetPos = BgCcMath.CalcPositionByDistance(distance); transform.position = TargetPos; distance += 0.1f * Time.deltaTime; }
public Vector3 GetPoint(float distance) => math.CalcPositionByDistance(distance);
void Update() { CurrentRectTransform.position = cam.WorldToScreenPoint(curveMath.CalcPositionByDistance(distanceDone)); }