public void FireBullet(float angle)
{
/*
* //Debug.Log("Fire");
* //Vector3 eulers = lookRot.eulerAngles;
* Quaternion rot = Quaternion.Euler(0, lookRot, 0);
*
* BulletController temp = Instantiate(tower.bulletPrefab, (Vector3)position + lookRot * firingHarness.transform.position, rot).GetComponent<BulletController>();
* Rigidbody rigidbody = temp.GetComponent<Rigidbody>();
* temp.damage = tower.damage;
*
* rigidbody.velocity = rot * (Vector2.up * 10);*/
Quaternion rot = Quaternion.Euler(0, angle, 90);
//BulletController temp = Instantiate(tower.bulletPrefab, firingHarnesses[currentFiringHarness++].transform.position, Quaternion.Euler(0, angle, 0)).GetComponentInChildren<BulletController>();
GameObject tempParent = PoolManager.ReuseObject(tower.bulletPrefab, firingHarnesses[currentFiringHarness++].transform.position, rot);
BulletController temp = tempParent.GetComponentInChildren <BulletController>();
temp.parent = tempParent;
Rigidbody tempRbody = temp.GetComponentInChildren <Rigidbody>();
temp.rbody = tempRbody;
tempRbody.velocity = Quaternion.Euler(0, angle - 90, 0) * (Vector3.forward * tower.bulletVelocity);
temp.tower = this;
currentFiringHarness = currentFiringHarness % firingHarnesses.Length;
/*if (firingHarnesses.Length >= currentFiringHarness)
* currentFiringHarness = 0;*/
if (tower.attackSpeed != 0f)
{
nextFireTime = Time.time + (1f / tower.attackSpeed);
}
}