Esempio n. 1
0
    void Shoot()
    {
        GameObject       bulletGo = (GameObject)Instantiate(bulletPrefab, firePoint.position, firePoint.rotation);
        TurretProjectile bullet   = bulletGo.GetComponent <TurretProjectile>();

        if (bullet != null)
        {
            bullet.Seek(target, damage);
        }
    }
Esempio n. 2
0
    void PewPew()
    {
        GameObject newProjectile = Instantiate(projectile, firePoint.position, transform.rotation);

        newProjectile.GetComponent <TurretProjectile>().damage = damage;
        newProjectile.GetComponent <TurretProjectile>().speed  = shotSpeed;

        TurretProjectile projectileScript = newProjectile.GetComponent <TurretProjectile>();

        if (projectileScript != null)
        {
            projectileScript.Seek(target);
        }
    }