public void LoadCharacter() { SaveData data = SaveLoad.LoadGame(); if (!data.Equals(null)) { CurHP = data.curHP; CurSP = data.curSP; Lvl = data.lvl; Money = data.money; MaxHP = data.hpLvl; SpLvl = data.spLvl; StrLvl = data.strLvl; BlockLvl = data.blockLvl; MoneyLVL = (int)100 + 100 * Lvl / 5; MaxHP = 100 * HpLvl; MaxSP = 100 * SpLvl; PlayerD = 30 * StrLvl; BlockStr = 1 * BlockLvl; transform.position = new Vector3(data.position[0], data.position[1], data.position[2]); HPchange.Invoke(CurHP); SPchange.Invoke(CurSP); Mchange.Invoke(Money); } }
public void AddMoney(int money) { Money += money; if (Mchange != null) { Mchange.Invoke(Money); } }