protected override void Shoot() { if (_bOverHeat) { return; } for (int i = 0; i < ShootPoints.Length; ++i) { if (AudioS) { AudioS.Play(); } GameObject shootPoint = ShootPoints[i]; GameObject newLaser = ProjectilePool.GetObjectFromPool("Laser"); newLaser.transform.position = shootPoint.transform.position; newLaser.transform.forward = shootPoint.transform.forward; newLaser.GetComponent <ProjectileBase>().Damage = Damage; if (CompareTag("Enemy")) { Target = FindObjectOfType <Player>().gameObject; } if (Target) { newLaser.transform.LookAt(Target.transform); } newLaser.GetComponent <Rigidbody>().velocity = newLaser.transform.forward * Speed; if (_particles[i]) { _particles[i].Play(); } if (CompareTag("Player")) { newLaser.GetComponent <LineRenderer>().startColor = Color.blue; newLaser.GetComponent <LineRenderer>().endColor = Color.blue; } if (CurrentOverHeat < MaxOverHeat) { CurrentOverHeat++; } CurrentOverHeat = Mathf.Min(CurrentOverHeat, MaxOverHeat); } }
protected override void Shoot() { if (CurrentAmmo == 0 || !_bShootAble) { return; } if (AudioS) { AudioS.Play(); } for (int i = 0; i < ShootPoints.Length; ++i) { _shootStart = Time.time; GameObject shootPoint = ShootPoints[i]; GameObject newMissile = ProjectilePool.GetObjectFromPool("Missile"); newMissile.transform.position = shootPoint.transform.position; newMissile.transform.forward = shootPoint.transform.forward; newMissile.GetComponent <ProjectileBase>().Damage = Damage; if (CompareTag("Enemy")) { Target = FindObjectOfType <Player>().gameObject; } if (Target) { newMissile.GetComponent <Missile>().SetTarget(Target); newMissile.transform.LookAt(Target.transform); } newMissile.GetComponent <Rigidbody>().velocity = shootPoint.transform.forward * Speed; if (CurrentAmmo > 0) { CurrentAmmo--; } CurrentAmmo = Mathf.Max(0, CurrentAmmo); _bShootAble = false; } }