示例#1
0
    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);
        }
    }
示例#2
0
    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;
            }
        }
    }
示例#3
0
文件: EWing.cs 项目: snaami/MusicWars
    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;
        }
    }
示例#4
0
 public void FireBigBlueProjectile(AudioBand bandData)
 {
     Fire(barrelPoints, bigBlueProjectilePrefab, 0.03f);
 }
示例#5
0
 public void FireLittleYellowProjectile(AudioBand bandData)
 {
     Fire(barrelPoints, littleYellowProjectilePrefab, 0.01f);
 }
示例#6
0
 public void FireBasicProjectile(AudioBand bandData)
 {
     Fire(barrelPoints, basicProjectilePrefab, 0.02f);
 }
示例#7
0
    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;
            }
        }
    }