Exemplo n.º 1
0
    //shoot bullet forward
    public override void Shoot(int shootPoint)
    {
        GameObject bullet = stockpile.GetBullet(bulletPrefab.name);

        bullet.transform.position = transform.position;
        bullet.transform.rotation = aim.transform.rotation;
        bullet.GetComponent <EnemyBullet>().Activate(bulletSpeed);
    }
Exemplo n.º 2
0
    //shoot bullet forward
    public override void Shoot(int shootPoint)
    {
        GameObject bullet;

        if (GameObject.Find("Bullets").GetComponent <BulletStockpile>())
        {
            bullet = stockpile.GetBullet(bulletPrefab.name);
        }
        else
        {
            bullet = Instantiate(bulletPrefab);
        }
        bullet.transform.position = transform.position;
        bullet.transform.rotation = aim.transform.rotation;
        bullet.GetComponent <EnemyBullet>().Activate(bulletSpeed);
    }
Exemplo n.º 3
0
    ////////////////////////////////////////////////////////////////

    public void Shoot(int shootPoint)
    {
        //iterate through shootpoints
        foreach (Transform sp in shootPoints.GetChild(shootPoint))
        {
            GameObject bullet = stockpile.GetBullet(bulletPrefabs[shootPoint].name);
            bullet.transform.position = sp.position;
            bullet.transform.rotation = sp.rotation;
            if (bullet.GetComponent <EnemyBullet>())
            {
                bullet.GetComponent <EnemyBullet>().Activate(bulletSpeed);
            }
            else
            {
                bullet.transform.GetChild(0).GetComponent <EnemyBullet>().Activate(bulletSpeed);
            }
        }
    }
Exemplo n.º 4
0
    ////////////////////////////////////////////////////////////////

    //shoot bullet forward
    public override void Shoot(int shootPoint)
    {
        foreach (Transform sp in points[shootPoint])
        {
            ////////////////////////////////////////////////////////////////

            GameObject bullet = stockpile.GetBullet(bulletPrefabs[shootPoint].name);
            bullet.transform.position = sp.position;
            bullet.transform.rotation = sp.rotation;

            ////////////////////////////////////////////////////////////////

            if (bullet.GetComponent <EnemyBullet>())
            {
                bullet.GetComponent <EnemyBullet>().Activate(bulletSpeeds[shootPoint]);
            }
            else
            {
                bullet.transform.GetChild(0).GetComponent <EnemyBullet>().Activate(bulletSpeeds[shootPoint]);
            }

            ////////////////////////////////////////////////////////////////
        }
    }