Ejemplo n.º 1
0
    public void ReturnProtectionSphere(ProtectionSphere protectionSphere)
    {
        if (!protectionSpheresPoolsDictionary.ContainsKey(protectionSphere.GetProtectionSpherePoolTag))
        {
            return;
        }

        protectionSphere.transform.parent = protectionSpheresPoolsDictionary[protectionSphere.GetProtectionSpherePoolTag].GetPoolParent;
        protectionSpheresPoolsDictionary[protectionSphere.GetProtectionSpherePoolTag].AddObjectInPool(protectionSphere);
    }
Ejemplo n.º 2
0
    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);
        }
    }