public override void FireBullet() { if (currentBomb) { currentBomb.Launch(); currentBomb = null; } else if (bulletType) { if (fireSources.Count <= 0) { GameObject newBomb = Instantiate(bulletType, transform.position, Quaternion.identity); newBomb.transform.SetParent(transform); currentBomb = newBomb.GetComponent <BombBullet>(); } else { GameObject newBomb = Instantiate(bulletType, fireSources[0].transform.position, Quaternion.identity); newBomb.transform.SetParent(fireSources[0].transform); currentBomb = newBomb.GetComponent <BombBullet>(); } } }
public override void FireBullet() { switch (bossState) { case BossState.Idle: break; case BossState.LazyBlaster: case BossState.RapidBlaster: if (bulletType) { if (fireSources.Count <= 0) { Instantiate(bulletType, transform.position, Quaternion.identity); } else { foreach (GameObject fireSource in fireSources) { Instantiate(bulletType, fireSource.transform.position, Quaternion.identity); } } } break; case BossState.ChargeBeam: ChargeWeapon(); break; case BossState.LightningStorm: if (boltBullets.Count > 0) { int boltNum = Random.Range(0, boltBullets.Count); boltBullets[boltNum].LightningStrike(); activeBolts.Add(boltBullets[boltNum]); boltBullets.RemoveAt(boltNum); } break; case BossState.Bomber: if (bombBullet) { if (fireSources.Count <= 0) { BombBullet newBomb = Instantiate(bombBullet, transform.position, Quaternion.identity).GetComponent <BombBullet>(); newBomb.Launch(); } else { foreach (GameObject fireSource in fireSources) { BombBullet newBomb = Instantiate(bombBullet, fireSource.transform.position, Quaternion.identity).GetComponent <BombBullet>(); newBomb.Launch(); } } } break; default: break; } }