예제 #1
0
    void Shoot()
    {
        GameObject bullet_obj    = (GameObject)Instantiate(bulletPrefab, fire_point.position, fire_point.rotation);
        bullet     bullet_script = bullet_obj.GetComponent <bullet> ();

        if (bullet_script != null)
        {
            bullet_script.Seek(target);
        }
    }
예제 #2
0
    void Shoot()
    {
        GameObject bulletGo = (GameObject)Instantiate(bulletPrefab, firePoint.position, firePoint.rotation);
        bullet     bullet   = bulletGo.GetComponent <bullet>();

        if (bullet != null)
        {
            bullet.Seek(target);
        }
    }
예제 #3
0
    void Shoot()
    {
        GameObject bulletGO = (GameObject)Instantiate(bulletPrefabs, firePoint.position, firePoint.rotation); //создание обьектов
        bullet     bullet1  = bulletGO.GetComponent <bullet>();

        audio.PlayOneShot(audioClip);
        if (bullet1 != null)
        {
            bullet1.Seek(target);
        }
    }