using System.Collections.Generic; using UnityEngine; using System.Collections; public class PlayerSkillTree { private static PlayerSkillTree _instance; private PotionHandler potionHandler; public static PlayerSkillTree Instance { get { if (_instance == null) { _instance = new PlayerSkillTree(); } return _instance; } } public enum Skills { Dash, Reflection1, Reflection2, Shockwave, Spin, Potion, Arrows1, Arrows2 } private List playerSkills; public PlayerSkillTree() { playerSkills = new List(); potionHandler = new PotionHandler(); } public void UnlockSkill(Skills skill, PotionHandler.PotionType potionType) { if(skill == Skills.Potion){ potionHandler.AddPotion(potionType); return; } if (playerSkills.Contains(skill)) return; playerSkills.Add(skill); } public bool TryUsePotion(PotionHandler.PotionType potionType) { if(potionHandler.IsEmpty(potionType)) return false; return potionHandler.UsePotion(potionType); } public bool IsSkillUnlocked(Skills skill) { return playerSkills.Contains(skill); } public List GetPlayerSkills() { return playerSkills; } }