public void AddSaveRecord(string saveFile) { BuildLookup(); ISlotInfo slotInfo = GameObject.FindGameObjectWithTag("Player").GetComponent <ISlotInfo>(); var state = (Dictionary <string, string>)slotInfo.CaptureState(); SaveRecord newRecord = new SaveRecord(); newRecord.playerName = state["name"]; newRecord.rank = state["rank"]; newRecord.time = state["time"]; newRecord.quest = state["quest"]; newRecord.location = state["location"]; newRecord.scene = state["scene"]; saveLookup[saveFile] = newRecord; }
public void AddSaveRecord(string saveFile) { if (saveLookup == null) { BuildLookup(); } ISlotInfo slotInfo = GameObject.FindGameObjectWithTag("GameController").GetComponent <ISlotInfo>(); var state = (Dictionary <string, string>)slotInfo.CaptureState(); SaveRecord newRecord = new SaveRecord(); newRecord.playerName = state["name"]; newRecord.money = state["money"]; newRecord.energy = state["energy"]; newRecord.location = state["location"]; newRecord.scene = state["scene"]; saveLookup[saveFile] = newRecord; }