IEnumerator CoroutineTric() { int y = 0; while (true) { int TricIndex = Random.Range(0, 4); for (int i = 0; i < 4; i++) { if (TricIndex == i) { _MANAGER.bulletFir("A4", position + new Vector3(i * 3.5f, 0, y * 7.2f), Vector3.up); } } yield return(new WaitForSeconds(1)); y++; if (y == 37) { break; } } yield return(new WaitForSeconds(7)); _MANAGER.bulletrest("A4"); }