public void ReturnProtectionSphere(ProtectionSphere protectionSphere) { if (!protectionSpheresPoolsDictionary.ContainsKey(protectionSphere.GetProtectionSpherePoolTag)) { return; } protectionSphere.transform.parent = protectionSpheresPoolsDictionary[protectionSphere.GetProtectionSpherePoolTag].GetPoolParent; protectionSpheresPoolsDictionary[protectionSphere.GetProtectionSpherePoolTag].AddObjectInPool(protectionSphere); }
public void SetCurrentProtectionParameters(ProtectionParameters protectionParameters) { if (protectionParameters.GetProtectionDuration == 0) { return; } currentProtectionParameters = protectionParameters; currentProtectionParameters.StartProtection(); if (currentProtectionParameters.GeneratesProtectionSphere) { ProtectionSphere newProtectionSphere = GameManager.gameManager.PoolManager.GetProtectionSphere(currentProtectionParameters.GetProtectionSphereType, PoolInteractionType.GetFromPool); newProtectionSphere.SetUpSphere(currentProtectionParameters.GetProtectionDuration, currentProtectionParameters.GetProtectionSphereRadius, transform, relatedShipHitbox.GetDamageTag); } }