コード例 #1
0
    private IEnumerator BurstFireBulletGroups()
    {
        int bulletsFired = 0;

        while (bulletsFired < BurstFireRate)
        {
            bulletsFired++;

            yield return(new WaitForSeconds(0.1f));

            Ammunition ammo = Instantiate(Ammo, transform.position + (transform.forward), transform.rotation);

            ammo.DamageOfRound = DamagePerHit;

            ammo.LaunchTowards(transform.position + (transform.forward * Range));

            if (EnableSideFire)
            {
                Ammunition rightShot = Instantiate(Ammo, transform.position + (transform.right), transform.rotation);

                rightShot.DamageOfRound = DamagePerHit;

                rightShot.LaunchTowards(transform.position + (transform.right * Range));

                Ammunition leftShot = Instantiate(Ammo, transform.position + (-transform.right), transform.rotation);

                leftShot.DamageOfRound = DamagePerHit;

                leftShot.LaunchTowards(transform.position + (-transform.right * Range));
            }
        }
    }