コード例 #1
0
    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();
    }