Exemplo n.º 1
0
    private void Update()
    {
        percentFloat = percentage * 0.01f;  //converts percentage whole number to float form for weighted generation of bullets

        if (poolBullets.Count() <= 0)
        {
            StartCoroutine(WaitToReload());
            poolBullets.ReUse();
        }
    }
Exemplo n.º 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++;
         }
     }
 }