void On_Firing_Received() { if (!poolBullets.IsEmpty()) { StartCoroutine(FireRoute()); //fires when player is detected } else { StopAllCoroutines(); StartCoroutine("StopFire"); } }
private void OnTriggerEnter(Collider other) { //Debug.Log(other.gameObject + " collider detected"); if (other.tag == "Player") { if (!poolBullets.IsEmpty()) { StartCoroutine(FireRoute()); //fires when player is detected } } }