void GenerateArmamentPrimaryPool(int quantity) { for (int currentObject = 0; currentObject < quantity; currentObject++) { GameObject instantiatedObject = gameManager.InstantiateObject(armamentPrimaryPrefab, transform, 0.0f, 30.0f, 0.0f, 1.0f, 1.0f, 1.0f); ArmamentPrimary armamentPrimary = instantiatedObject.GetComponent <ArmamentPrimary>(); armamentPrimary.prefabPools = this; armamentPrimary.StartSetup(); //armamentPrimary.PushOnStack(); } }
void ShootTarget(Transform target) { if (topDroneShooting) { ArmamentPrimary shipArmamentPrimary = prefabPools.PopArmamentPrimary(); if (shipArmamentPrimary != null) { shipArmamentPrimary.enabled = true; shipArmamentPrimary.PopOffStack(damagePerShot, 0, 2, spriteSideDrone1.transform.position.x, spriteSideDrone1.transform.position.y, 0.75f); shipArmamentPrimary.AimAtTarget(target, spriteSideDrone1.transform); } } else { ArmamentPrimary shipArmamentPrimary = prefabPools.PopArmamentPrimary(); if (shipArmamentPrimary != null) { shipArmamentPrimary.enabled = true; shipArmamentPrimary.PopOffStack(damagePerShot, 0, 2, spriteSideDrone2.transform.position.x, spriteSideDrone2.transform.position.y, 0.75f); shipArmamentPrimary.AimAtTarget(target, spriteSideDrone2.transform); } } topDroneShooting = !topDroneShooting; }