//only for use by the above 2 void setUnitStatsSaver(ref unitStats current_toy, unitStatsSaver toy, bool set_max_lvl) { int old_max_lvl = current_toy.getMaxLvl(); if (set_max_lvl) {// I HATE THIS SHIT if (toy.toy_id.toy_type == ToyType.Hero) { int new_max_lvl = Mathf.Max(toy.getMaxLvl(), old_max_lvl); foreach (Rune h in hero_toy_stats) { //if (h.toy_name.Equals(toy.name)) if (h.runetype == toy.toy_id.rune_type && h.toy_type == toy.toy_id.toy_type) { new_max_lvl = Mathf.Max(toy.getMaxLvl(), (int)h.getMaxLevel()); h.setMaxLevel(new_max_lvl); } } current_toy.setMaxLvl(new_max_lvl); } else { current_toy.setMaxLvl(toy.getMaxLvl()); } } else { current_toy.setMaxLvl(old_max_lvl); } }
public unitStatsSaver getSnapshot() { unitStatsSaver saver = new unitStatsSaver(); saver.name = this.name; saver.toy_id = this.toy_id.DeepClone(); saver.isUnlocked = this.isUnlocked; saver.max_lvl = this.max_lvl; return(saver); }
public void setUnitStats(unitStatsSaver toy, bool set_max_lvl) { unitStats current_toy = getToy(toy.toy_id.rune_type, toy.toy_id.toy_type); if (current_toy != null) { setUnitStatsSaver(ref current_toy, toy, set_max_lvl); return; } else { Debug.LogError("Could not set actor stats from actorStatsSaver for toy " + toy.name + "\n"); } }
public void loadSnapshot(unitStatsSaver load_me) { //if (load_me.name.Equals(this.name) this.isUnlocked = load_me.isUnlocked; }