コード例 #1
0
    void Shoot()
    {
        GameObject bulletGameObject = (GameObject)Instantiate(bulletPrefab, firePoint.position, firePoint.rotation);
        Bullet     bullet           = bulletGameObject.GetComponent <Bullet>();

        if (bullet != null)
        {
            //Debuffs
            if (slowTower)
            {
                bullet.ApplyDebuff(1, slowDuration, slowAmount);
            }
            if (weakenedTower)
            {
                bullet.ApplyDebuff(2, weakenedDuration, weakenedAmount);
            }
            if (burningTower)
            {
                bullet.ApplyDebuff(3, burningDuration, bullet.damage);
            }
            if (extraDamageTower)
            {
                bullet.damage = bullet.damage * (int)extraDamageAmount;
            }

            bullet.Seek(target);
        }
    }