public static void LoadSkill() { skills.Clear(); userSkills.Clear(); string path = Application.persistentDataPath + "/Xml/Skill.Xml"; SkillDatabase sd = null; SkillDatabase userSd = null; if (System.IO.File.Exists(path)) { sd = SkillDatabase.Load(); userSd = SkillDatabase.LoadUser(); } else { sd = SkillDatabase.InitSetting(); userSd = SkillDatabase.LoadUser(); } if (sd != null) { foreach (Skill skill in sd.skills) { skills.Add(skill); } } if (userSd != null) { foreach (Skill skill in userSd.skills) { userSkills.Add(skill); } } if (sd != null && userSd != null) { Debugging.LogSystem("SkillDatabase is loaded Succesfully."); } SetObtainPlayerSkill(); }
// Use this for initialization void Start() { dataArmor = ArmorDatabase.Load("Armors"); dataEnemy = EnemyDatabase.Load("Enemies"); dataEss = EssenceDatabase.Load("Essences"); dataItem = ItemDatabase.Load("Items"); dataNpc = NPCDatabase.Load("NPCs"); dataPot = PotionDatabase.Load("Potions"); dataScroll = ScrollDatabase.Load("Scrolls"); dataSkill = SkillDatabase.Load("Skills"); dataTali = TalismanDatabase.Load("Talismans"); dataWep = WeaponDatabase.Load("Weapons"); Debug.Log("Database Loaded"); foreach (Armor arm in dataArmor.armors) { arm.found = true; if (arm.found) { Debug.Log("Armor 0" + arm.ID + ":" + arm.Name); } } }