using Kryz.CharacterStats.Examples; using System.Collections; using System.Collections.Generic; using UnityEngine; /*[CreateAssetMenu] public class AbilityTomePage : ConsumableItem { public int abilityIndex; public GameEvent_Int onAbilityTomePageLearned; public override void Consume() { PlayerDataHandler.Instance.SaveAbilityTomeProgress(PlayerDataHandler.Instance.currentPlayerName.Value, abilityIndex, 1); onAbilityTomePageLearned.Raise(abilityIndex); } }*/ [System.Serializable] public class AbilityTomePageInstance : ConsumableItemInstance { public int abilityIndex; public GameEvent_Int onAbilityTomePageLearned; public AbilityTomePageInstance(BaseAbility ability, Item template, GameEvent_Int onAbilityTomePageLearned) { ItemName = "Forgotten "+ ability.displayName + "'s Tome Page"; Icon = template.Icon; templateIndex = ItemIndexer.Instance.Items.IndexOf(template); sellPricePlayer = template.sellPricePlayer; sellPriceVendor = template.sellPriceVendor; description = template.description; templateIndex = AbilityIndexer.Instance.Abilities.IndexOf(ability); abilityIndex = templateIndex; this.onAbilityTomePageLearned = onAbilityTomePageLearned; } public override void Consume() { PlayerDataHandler.Instance.SaveAbilityTomeProgress(PlayerDataHandler.Instance.currentPlayerName.Value, abilityIndex, 1); onAbilityTomePageLearned.Raise(abilityIndex); } }