public IEnumerator OffsetBeatAnimation() { float delay = 1 / (BpmValue / 60); MenuAnimator menuAnimator = FindObjectOfType <MenuAnimator>(); yield return(new WaitForSeconds(OffsetValue)); StartCoroutine(menuAnimator.PlayBeatAnimation(delay)); }