public void ConfirmButtonOnClick() { if (selectedArchetypeItem == null || selectedAbilityBase == null) { return; } if (!GameManager.Instance.PlayerStats.ArchetypeInventory.Contains(selectedArchetypeItem)) { return; } AbilityCoreItem abilityStorageItem = AbilityCoreItem.CreateAbilityItemFromArchetype(selectedArchetypeItem, selectedAbilityBase); if (abilityStorageItem == null) { return; } GameManager.Instance.PlayerStats.AddAbilityToInventory(abilityStorageItem); SaveManager.CurrentSave.SavePlayerData(); SaveManager.Save(); ResetPanel(); confirmButton.interactable = false; }
public void RemoveAbilityCoreData(AbilityCoreItem abilityCore) { AbilityCoreSaveData saveData = abilityCoreList.Find(x => x.id == abilityCore.Id); if (saveData != null) { abilityCoreList.Remove(saveData); } }
public bool AddAbilityToInventory(AbilityCoreItem newAbility) { if (abilityStorageInventory.Contains(newAbility)) { return(false); } abilityStorageInventory.Add(newAbility); SaveManager.CurrentSave.SaveAbilityCoreData(newAbility); return(true); }
public void SaveAbilityCoreData(AbilityCoreItem abilityCore) { abilityCoreList.Add(new AbilityCoreSaveData(abilityCore.Id, abilityCore.Base.idName, abilityCore.Name)); }
public bool RemoveAbilityFromInventory(AbilityCoreItem newAbility) { abilityStorageInventory.Remove(newAbility); SaveManager.CurrentSave.RemoveAbilityCoreData(newAbility); return(true); }