void CreateNewProfile()
    {
        CharacterModel model = new CharacterModel();

        model.attribute           = new Attribute();
        model.elemental           = new ElementAttribute();
        model.name                = pName.text;
        model.level               = 1;
        model.attribute.endurance = attEnd.GetValue();
        model.attribute.agi       = attAgi.GetValue();
        model.attribute.cons      = attCon.GetValue();
        model.attribute.intel     = attInt.GetValue();
        model.attribute.wisdom    = attWis.GetValue();
        model.attribute.str       = attStr.GetValue();
        model.battleSetting       = new BattleSetting();
        model.actives             = new List <string>();
        model.actives.Add("");
        model.actives.Add("");
        model.actives.Add("");
        model.actives.Add("");
        model.actives.Add("");
        model.passives = new List <string>();
        model.passives.Add("");
        model.passives.Add("");
        model.passives.Add("");
        model.passives.Add("");
        model.passives.Add("");
        PlayerSession.GetInstance().CreateNewSession(model);
        PlayerSession.GetInstance().SaveSession();
    }
Esempio n. 2
0
 public void WinDungeonLoot()
 {
     foreach (Loot loot in itemLoot)
     {
         PlayerSession.GetProfile().AddItem(loot.itemId, loot.amount);
     }
     PlayerSession.GetInstance().SaveSession();
 }
 void UpdateModelAttribute()
 {
     toLevelUp.levelUp             = false;
     toLevelUp.attribute           = new Attribute();
     toLevelUp.elemental           = new ElementAttribute();
     toLevelUp.name                = pName.text;
     toLevelUp.level              += LevelCalculator.CalculateGainedLevel(toLevelUp.exp, toLevelUp.level);
     toLevelUp.attribute.endurance = attEnd.GetValue();
     toLevelUp.attribute.agi       = attAgi.GetValue();
     toLevelUp.attribute.cons      = attCon.GetValue();
     toLevelUp.attribute.intel     = attInt.GetValue();
     toLevelUp.attribute.wisdom    = attWis.GetValue();
     toLevelUp.attribute.str       = attStr.GetValue();
     PlayerSession.GetInstance().SaveSession();
 }
 void LoadGameSession()
 {
     if (PlayerSession.GetInstance().IsSessionAvailable())
     {
         ContinueGameSession();
     }
     else
     {
         if (PlayerSession.GetInstance().LoadSession())
         {
             CreateNewSession();
         }
         else
         {
             ContinueGameSession();
         }
     }
 }
 void AllPlayerGetExperience()
 {
     playerList.ForEach(player => player.GetExperience(GetAllMonsterExperience()));
     PlayerSession.GetInstance().SaveSession();
 }
 public void ShowPartyWindow()
 {
     HideAllWindow();
     partyManager.gameObject.SetActive(true);
     PlayerSession.GetInstance().SaveSession();
 }