public void loadSave () { if (GameInstance == null) { if ((GameInstance = InstanceConf.loadInstance ()) == null) { InstanceConf.createInstance ((Instance Inst) => { GameInstance = Inst; ReviewMgr.CompleteReview (); InstanceConf.saveInstance (Inst); }); } Debug.Log ("StateFunding Save Loaded"); } }
public Instance loadInstance () { ConfigNode CnfNode = ConfigNode.Load (saveFilePath); if (CnfNode == null) { return null; } else { Instance Inst = new Instance (); ConfigNode.LoadObjectFromConfig (Inst, CnfNode); for (int i = 0; i < StateFundingGlobal.fetch.Governments.ToArray ().Length; i++) { Government Gov = StateFundingGlobal.fetch.Governments.ToArray () [i]; if (Gov.name == Inst.govName) { Inst.Gov = Gov; } } return Inst; } }
public void unload() { ViewManager.removeAll (); GameInstance = null; }
public void saveInstance (Instance Inst) { ConfigNode CnfNode = ConfigNode.CreateConfigFromObject (Inst); CnfNode.Save (saveFilePath); }
private void OnConfirm () { Instance Inst = new Instance (); Inst.Gov = SelectedGovernment; Inst.govName = SelectedGovernment.name; Inst.po = (int)SelectedGovernment.startingPO; Inst.sc = (int)SelectedGovernment.startingSC; ViewManager.removeView (this); OnCreateCallback (Inst); }