void Start() { m_AudioSource = GetComponent <AudioSource>(); s = GetComponent <Sampler>(); Bands = new AudioBand[8]; for (int j = 0; j < Bands.Length; j++) { Bands[j] = new AudioBand(s); } }
void InitializeBandData() { bandData = new AudioBand[numBands * channels.Length]; foreach (int c in channels) { for (int band = 0; band < numBands; band++) { int idx = band + (numBands * c); bandData[idx] = new AudioBand(bandWidth[band], c, (Bands)band); bandOffsets[c, band] = idx; } } }
public void Fire(AudioBand bandData) { if (tSinceLastFire < maxFireSpeed || splPower < 1) { return; } tSinceLastFire = 0; foreach (Transform b in barrels) { if (deltaTime > 0.033f) { continue; } GameObject proj = SimplePool.Catch(projectilePrefab, b.position, b.rotation); EnemyProjectile.rbRegistry[proj].velocity = b.forward * splPower; EnemyProjectile.epRegistry[proj].damage = (int)splPower; } }
public void FireBigBlueProjectile(AudioBand bandData) { Fire(barrelPoints, bigBlueProjectilePrefab, 0.03f); }
public void FireLittleYellowProjectile(AudioBand bandData) { Fire(barrelPoints, littleYellowProjectilePrefab, 0.01f); }
public void FireBasicProjectile(AudioBand bandData) { Fire(barrelPoints, basicProjectilePrefab, 0.02f); }
void InitializeBandData() { bandData = new AudioBand[numBands * channels.Length]; foreach (int c in channels) { for (int band = 0; band < numBands; band++) { int idx = band + (numBands * c); bandData[idx] = new AudioBand(bandWidth[band], c, (Bands) band); bandOffsets[c,band] = idx; } } }