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();
 }
 public void SetForLevelUp(CharacterModel model)
 {
     //TODO Badly need new recalculation on total attributes
     isNewGame = false;
     if (model.exp > 0)
     {
         bonusValue = LevelCalculator.CalculateGainedLevel(model.exp, model.level) * 3;
     }
     else
     {
         bonusValue = 15;
     }
     //pName.interactable = false;
     initialAttr = model.attribute.DeepCopy();
     pName.text  = model.name;
     toLevelUp   = model;
     LoadModelAttribute(model.attribute);
     startingValue = TotalAttributeValue();
     RecalculateRemainingValue();
 }