void FireFix() //using pooled objects to fire projectiles
 {
     if (fullClip > 0)
     {
         try
         {
             GameObject temp = poolBullets.Get(gunBarrel.transform.position);
             temp.GetComponent <Rigidbody>().velocity = Vector3.right * directionModifier * fireForce;
         }
         catch (System.NullReferenceException)
         {
             Debug.Log("Out of bullets, enemy");
             throw;
         }
         fullClip--;
     }
 }
Beispiel #2
0
 void FireBall()
 {
     if (fullClip > 0)
     {
         try
         {
             GameObject temp = poolBullets.Get(gunBarrel.transform.position);
             temp.GetComponent <Rigidbody>().velocity = Vector3.right * direction * enemyStats.shotForce;
         }
         catch (System.NullReferenceException)
         {
             throw;
         }
         fullClip--;
     }
     else
     {
         for (int i = 0; i < enemyStats.bulletAmount; i++)
         {
             poolBullets.ReUse();
             fullClip++;
         }
     }
 }
Beispiel #3
0
    void FireFix() //using pooled objects to fire projectiles
    {
        GameObject temp = poolBullets.Get(gunBarrel.transform.position);

        temp.GetComponent <Rigidbody>().velocity = Vector3.right * directionModifier * fireForce;
    }