Beispiel #1
0
    /// <summary>
    /// Dispara la cantidad de balas especificadas eniShotNumber en la transformada
    /// spawnPos
    /// </summary>
    public void Shoot()
    {
        if (bReloading || !bIsActive)
        {
            return;
        }
        float sep = 180f / (float)(iShotNumber + 1);

        //bulletShooter.ShootBullet((Vector2)spawnPos.position, spawnPos.up * fBulletSpeed, 0, bulletTeamMask, bulletCollMask);
        for (int i = 1; i <= iShotNumber; i++)
        {
            Vector3 dir1 = (Vector2)spawnPos.right * Mathf.Cos(sep * i * Mathf.Deg2Rad) + (Vector2)spawnPos.up * Mathf.Sin(sep * i * Mathf.Deg2Rad);
            bulletShooter.ShootBullet((Vector2)spawnPos.position, dir1 * fBulletSpeed, 0, bulletTeamMask, bulletCollMask);
        }
        StartCoroutine(FireRate());
    }