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--; } }
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++; } } }
void FireFix() //using pooled objects to fire projectiles { GameObject temp = poolBullets.Get(gunBarrel.transform.position); temp.GetComponent <Rigidbody>().velocity = Vector3.right * directionModifier * fireForce; }