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--;
     }
 }
示例#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++;
         }
     }
 }
示例#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;
    }