public void Update() { if (times < 30 && flag == 0) { if (interval <= 0) { interval = Random.Range(3, 5); times++; df.GenSkeet(); } interval -= Time.deltaTime; } actionManager.PlaySkeet(); }