Exemple #1
0
    public override void Fire()
    {
        Bullet_SimpleBullet bullet = GameObject.Instantiate(bulletPrefab, handPosition.position, handPosition.rotation).AddComponent <Bullet_SimpleBullet>();
        BulletData          data   = GetBulletData();

        bullet.SetBulletData(data);
        BulletsShot++;
    }
Exemple #2
0
    public override void Fire()
    {
        Quaternion rotationA = Quaternion.Euler(handPosition.rotation.eulerAngles + new Vector3(0f, spreadAngle, 0f));
        Quaternion rotationB = Quaternion.Euler(handPosition.rotation.eulerAngles + new Vector3(0f, -spreadAngle, 0f));

        Bullet_SimpleBullet bullet1 = GameObject.Instantiate(bulletPrefab, handPosition.position, rotationA).AddComponent <Bullet_SimpleBullet>();
        Bullet_SimpleBullet bullet2 = GameObject.Instantiate(bulletPrefab, handPosition.position, rotationB).AddComponent <Bullet_SimpleBullet>();

        if (isWeaponModified == true)
        {
            usingBulletData  = GetBulletData();
            isWeaponModified = false;
        }

        bullet1.SetBulletData(usingBulletData);
        bullet2.SetBulletData(usingBulletData);
        BulletsShot += 2;
    }