only shoot in rounds
This commit is contained in:
parent
814d455eab
commit
a57582fdc8
|
@ -31,6 +31,12 @@ public class BeamTower : AimTower
|
||||||
private IEnumerator AttackLoop()
|
private IEnumerator AttackLoop()
|
||||||
{
|
{
|
||||||
do {
|
do {
|
||||||
|
if (GameManager.Instance.CurrentNumEnemies == 0)
|
||||||
|
{
|
||||||
|
yield return new WaitForEndOfFrame();
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
Vector3 origin = barrel.Tip.position;
|
Vector3 origin = barrel.Tip.position;
|
||||||
Vector3 rayDir = barrel.transform.forward;
|
Vector3 rayDir = barrel.transform.forward;
|
||||||
|
|
||||||
|
|
|
@ -35,6 +35,8 @@ public class GravityTower : Tower
|
||||||
|
|
||||||
protected override void FixedUpdate()
|
protected override void FixedUpdate()
|
||||||
{
|
{
|
||||||
|
if (GameManager.Instance.CurrentNumEnemies == 0) return;
|
||||||
|
|
||||||
Collider[] projectilesInRadius = Physics.OverlapSphere(orb.position, radius, affectedBodies);
|
Collider[] projectilesInRadius = Physics.OverlapSphere(orb.position, radius, affectedBodies);
|
||||||
foreach (var projectile in projectilesInRadius)
|
foreach (var projectile in projectilesInRadius)
|
||||||
{
|
{
|
||||||
|
|
|
@ -31,6 +31,14 @@ public class ProjectileTower : AimTower
|
||||||
private IEnumerator AttackLoop()
|
private IEnumerator AttackLoop()
|
||||||
{
|
{
|
||||||
do {
|
do {
|
||||||
|
Debug.Log($"{GameManager.Instance.CurrentNumEnemies == 0}");
|
||||||
|
|
||||||
|
if (GameManager.Instance.CurrentNumEnemies == 0)
|
||||||
|
{
|
||||||
|
yield return new WaitForEndOfFrame();
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
yield return new WaitForSeconds(attackSecondsDelay);
|
yield return new WaitForSeconds(attackSecondsDelay);
|
||||||
Debug.DrawRay(transform.position, horizontalArc.ToKnobVector, Color.red, attackSecondsDelay);
|
Debug.DrawRay(transform.position, horizontalArc.ToKnobVector, Color.red, attackSecondsDelay);
|
||||||
Debug.DrawRay(transform.position, verticalArc.ToKnobVector, Color.green, attackSecondsDelay);
|
Debug.DrawRay(transform.position, verticalArc.ToKnobVector, Color.green, attackSecondsDelay);
|
||||||
|
|
Loading…
Reference in New Issue