protected override IEnumerator Shoot()
    {
        while (this.isActiveAndEnabled)
        {
            rfBullet = pooler.GetPooledObject(5);
            if (rfBullet == null)
            {
                rfBullet = pooler.PoolMoreBullets(5);
            }
            rfBullet.transform.position      = transform.position;
            rfBullet.transform.localRotation = transform.rotation;
            rfBullet.SetActive(true);

            //Instantiate(rapidFireBullet, transform.position, transform.rotation);
            yield return(new WaitForSeconds(shootDelay));
        }
    }
 protected override IEnumerator Shoot()
 {
     //spawn a bullet
     while (this.isActiveAndEnabled)
     {
         GameObject bullet = pooler.GetPooledObject(0);
         if (bullet == null)
         {
             bullet = pooler.PoolMoreBullets(0);
         }
         bullet.transform.position      = transform.position;
         bullet.transform.localRotation = transform.rotation;
         bullet.SetActive(true);
         //Instantiate(bulletPrefab, transform.position, transform.rotation);
         yield return(new WaitForSeconds(shootDelay));
     }
 }
예제 #3
0
 protected override IEnumerator Shoot()
 {
     while (this.isActiveAndEnabled)
     {
         for (int i = 0; i <= 11; i++)
         {
             GameObject bullet = pooler.GetPooledObject(0);
             if (bullet == null)
             {
                 bullet = pooler.PoolMoreBullets(0);
             }
             bullet.transform.position      = transform.position;
             bullet.transform.localRotation = Quaternion.Euler(0, 0, -180);
             bullet.transform.Rotate(0, 0, i * 30);
             bullet.SetActive(true);
         }
         yield return(new WaitForSeconds(shootDelay));
     }
 }
 protected override IEnumerator Shoot()
 {
     while (this.isActiveAndEnabled)
     {
         for (int i = -2; i <= 2; i++)
         {
             Bullet = pooler.GetPooledObject(0);
             if (Bullet == null)
             {
                 Bullet = pooler.PoolMoreBullets(0);
             }
             Bullet.transform.position      = transform.position;
             Bullet.transform.localRotation = transform.rotation;
             Bullet.transform.Rotate(0, 0, i * 15);
             Bullet.SetActive(true);
         }
         yield return(new WaitForSeconds(shootDelay));
     }
 }
예제 #5
0
    protected override IEnumerator Shoot()
    {
        yield return(new WaitForSeconds(0.7f));

        while (this.isActiveAndEnabled)
        {
            for (int i = 0; i < BulletAmount; i++)
            {
                rocketBullet = pooler.GetPooledObject(bulletIndexInPooler);
                if (rocketBullet == null)
                {
                    rocketBullet = pooler.PoolMoreBullets(bulletIndexInPooler);
                }
                rocketBullet.transform.position      = transform.position;
                rocketBullet.transform.localRotation = transform.rotation;
                rocketBullet.SetActive(true);
                yield return(new WaitForSeconds(0.5f));
            }

            //Instantiate(rapidFireBullet, transform.position, transform.rotation);
            yield return(new WaitForSeconds(shootDelay));
        }
    }