Пример #1
0
 private static void InitUserData(string localId, string name)
 {
     SaveSystem.InitPlayer(localId, name);
     ItemDatabase.InitSetting();
     HeroDatabase.InitSetting();
     AbilityDatabase.InitSetting();
     SkillDatabase.InitSetting();
     MissionDatabase.InitSetting();
     MapDatabase.InitSetting();
     SaveData();
 }
Пример #2
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();
    }