コード例 #1
0
ファイル: StateFunding.cs プロジェクト: nanathan/StateFunding
    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");
      }
    }
コード例 #2
0
    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;
      }
    }
コード例 #3
0
ファイル: StateFunding.cs プロジェクト: ABZB/StateFunding
 public void unload()
 {
     ViewManager.removeAll ();
       GameInstance = null;
 }
コード例 #4
0
 public void saveInstance (Instance Inst) {
   ConfigNode CnfNode = ConfigNode.CreateConfigFromObject (Inst);
   CnfNode.Save (saveFilePath);
 }
コード例 #5
0
 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);
 }