public void LoadGame() { var idx = Serializer.XMLDeSerialize <SaveFileSetting>(UISL.settingPath).idxSel; var savefile = Serializer.XMLDeSerialize <SaveFile>(UISL.path(idx)); Game.totalTime = savefile.totalGameTime; charName = savefile.name; hpMax = savefile.hpMax; // 先赋值max以正常显示 hp = savefile.hp; mpMax = savefile.mpMax; mp = savefile.mp; agility = savefile.agility; lvl = savefile.lvl; exp = savefile.exp; }
public void SaveGame() { var idx = Serializer.XMLDeSerialize <SaveFileSetting>(UISL.settingPath).idxSel; Serializer.XMLSerialize(new SaveFile() { totalGameTime = Game.totalTime, name = charName, hp = hp, hpMax = hpMax, mp = mp, mpMax = mpMax, agility = agility, lvl = lvl, exp = exp, }, UISL.path(idx)); }