예제 #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 LoadAbility()
    {
        abilities.Clear();
        userAbilities.Clear();
        string          path   = Application.persistentDataPath + "/Xml/Ability.Xml";
        AbilityDatabase ad     = null;
        AbilityDatabase userAd = null;

        if (System.IO.File.Exists(path))
        {
            ad     = AbilityDatabase.Load();
            userAd = AbilityDatabase.LoadUser();
        }
        else
        {
            ad     = AbilityDatabase.InitSetting();
            userAd = AbilityDatabase.LoadUser();
        }

        if (ad != null)
        {
            foreach (Ability ability in ad.abilities)
            {
                abilities.Add(ability);
            }
        }
        if (userAd != null)
        {
            foreach (Ability ability in userAd.abilities)
            {
                userAbilities.Add(ability);
            }
            SetAbilityStats();
        }
        if (ad != null && userAd != null)
        {
            Debugging.LogSystem("AbilityDatabase is loaded Succesfully.");
        }
    }