public virtual void FireShots(GameObject _towerTarget, GameObject _ammoToFire, Transform _ammoSpawnPt, TowerType _type) { if (isBuilding == false) { transform.LookAt(_towerTarget.transform.position); GameObject ammoSpawn = (GameObject)Instantiate(_ammoToFire, _ammoSpawnPt.position, _ammoSpawnPt.rotation); AmmoScript ammo = ammoSpawn.GetComponent <AmmoScript> (); ammo.AmmoTarget(_towerTarget.transform); Destroy(ammoSpawn, 5.0f); Debug.Log(_type + " tower is firing..."); if (!isShooting) { isShooting = true; Invoke("StopFiring", fireRate); } } }