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(); } }
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++; } } }