示例#1
0
    private void CreateRecoveryMethods()
    {
        int count = abilityData.recoveryData.Count;

        for (int i = 0; i < count; i++)
        {
            AbilityRecovery newRevovrey = EffectFactory.CreateRecovery(this, abilityData.recoveryData[i]);
            RecoveryManager.AddRecoveryMethod(newRevovrey);
        }
    }
    public void AddRecoveryMethod(AbilityRecovery recoveryMethod)
    {
        int count = recoveryMethods.Count;

        for (int i = 0; i < count; i++)
        {
            if (recoveryMethods[i].type == recoveryMethod.type)
            {
                Debug.LogError(ParentAbility.abilityName + " already has a recovery method of type: " + recoveryMethod.type);
                return;
            }
        }

        recoveryMethods.Add(recoveryMethod);
    }
示例#3
0
    public static AbilityRecovery CreateRecovery(Ability parent, RecoveryData data)
    {
        AbilityRecovery result = null;

        switch (data.type)
        {
        case Constants.AbilityRecoveryType.Cooldown:
            result = new RecoveryCooldown(data.cooldown, parent, parent.RecoveryManager);
            break;

        default:

            break;
        }


        return(result);
    }
 public void RemoveRecoveryMethod(AbilityRecovery recoveryMethod)
 {
     recoveryMethods.RemoveIfContains(recoveryMethod);
 }