// fonction appelée lorsque l'arme de la tour est activée public override void Shoot() { if (Time.time - timeLastShoot > frequency) { isShooting = true; timeLastShoot = Time.time; if (projectilePoolReady.Count > 0) { go = (GameObject)projectilePoolReady[0]; go.SetActive(true); bullet = go.GetComponent(typeof(ProjectileGun)) as ProjectileGun; bullet.isExpired = false; bullet.shooter = shootFromTransform; bullet.target = null; bullet.Shoot(); projectilePoolReady.RemoveAt(0); projectilePoolActive.Add(go); } } else { isShooting = false; } }
// fonction appelée lorsque l'arme de la tour est activée public override void Shoot() { if(Time.time - timeLastShoot > frequency) { isShooting = true; timeLastShoot = Time.time; if(projectilePoolReady.Count > 0) { go = (GameObject) projectilePoolReady[0]; go.SetActive(true); bullet = go.GetComponent(typeof(ProjectileGun)) as ProjectileGun; bullet.isExpired = false; bullet.shooter = shootFromTransform; bullet.target = null; bullet.Shoot(); projectilePoolReady.RemoveAt(0); projectilePoolActive.Add(go); } } else { isShooting = false; } }