// Update is called once per frame void Update() { currentTime += Time.deltaTime; if (currentTime > time) { currentTime = 0; foreach (var barrel in enemyComponent.GetActiveBarrels()) { pool.GetObjFromPool(barrel.position, barrel.rotation); } } }
// Update is called once per frame void Update() { if (!shoot) { return; } currentTime += Time.deltaTime; if (currentTime > time) { currentTime = 0; foreach (var barrel in playerComponent.GetActiveBarrels()) { pool.GetObjFromPool(barrel.position, Quaternion.identity); } } }