Exemple #1
0
        public static BlueprintActivatableAbility CreateActivatableAbility(ActivatableAbilityData activatableAbilityData)
        {
            var ability = Create <BlueprintActivatableAbility>();

            ability.name = activatableAbilityData.Name;
            blueprintScriptableObject_set_AssetId(ability, activatableAbilityData.Guid);
            ability.SetName(Localization.CreateString(activatableAbilityData.DisplayNameLocalizationKey, activatableAbilityData.DisplayNameText));
            ability.SetDescription(Localization.CreateString(activatableAbilityData.DescriptionLocalizationKey, activatableAbilityData.DescriptionText));
            if (activatableAbilityData.IconAssetGuid != null)
            {
                ability.SetIcon(activatableAbilityData.IconAssetGuid);
            }
            else if (activatableAbilityData.IconFileName != null)
            {
                ability.SetIcon(LoadIcons.Load(LoadIcons.IconsFolder + activatableAbilityData.IconFileName));
            }
            return(ability);
        }
Exemple #2
0
        public static BlueprintAbility CreateAbility(AbilityData abilityData)
        {
            var ability = Create <BlueprintAbility>();

            ability.name = abilityData.Name;
            blueprintScriptableObject_set_AssetId(ability, abilityData.Guid);
            ability.SetName(Localization.CreateString(abilityData.DisplayNameLocalizationKey, abilityData.DisplayNameText));
            ability.SetDescription(Localization.CreateString(abilityData.DescriptionLocalizationKey, abilityData.DescriptionText));
            if (abilityData.IconAssetGuid != null)
            {
                ability.SetIcon(abilityData.IconAssetGuid);
            }
            else if (abilityData.IconFileName != null)
            {
                ability.SetIcon(LoadIcons.Load(LoadIcons.IconsFolder + abilityData.IconFileName));
            }
            ability.Type       = abilityData.Type;
            ability.Range      = abilityData.Range;
            ability.ActionType = abilityData.ActionType;
            blueprintAbility_set_m_IsFullRoundAction(ability, abilityData.IsFullRoundAction);

            if (abilityData.DurationLocalizationKey == null)
            {
                ability.LocalizedDuration = new LocalizedString();
            }
            else
            {
                ability.LocalizedDuration = Localization.CreateString(abilityData.DurationLocalizationKey, abilityData.DurationLocalizationText);
            }

            if (abilityData.SavingThrowLocalizationKey == null)
            {
                ability.LocalizedSavingThrow = new LocalizedString();
            }
            else
            {
                ability.LocalizedSavingThrow = Localization.CreateString(abilityData.SavingThrowLocalizationKey, abilityData.SavingThrowLocalizationText);
            }

            return(ability);
        }