コード例 #1
0
ファイル: StateFunding.cs プロジェクト: nanathan/StateFunding
    private void InitGovernments () {
      Governments = new List<Government> ();

      ConfigNode GovConfig = ConfigNode.Load ("GameData/StateFunding/data/governments.settings");
      ConfigNode[] GovItems = GovConfig.GetNode ("Governments").GetNodes ();
      for (var i = 0; i < GovItems.Length; i++) {
        ConfigNode GovItem = GovItems [i];
        Government Gov = new Government ();

        Gov.name = GovItem.GetValue ("name");
        Gov.longName = GovItem.GetValue ("longName");
        Gov.poModifier = float.Parse(GovItem.GetValue ("poModifier"));
        Gov.poPenaltyModifier = float.Parse(GovItem.GetValue ("poPenaltyModifier"));
        Gov.scModifier = float.Parse (GovItem.GetValue ("scModifier"));
        Gov.scPenaltyModifier = float.Parse (GovItem.GetValue ("scPenaltyModifier"));
        Gov.startingPO = int.Parse (GovItem.GetValue ("startingPO"));
        Gov.startingSC = int.Parse (GovItem.GetValue ("startingSC"));
        Gov.budget = float.Parse (GovItem.GetValue ("budget"));
        Gov.gdp = int.Parse (GovItem.GetValue ("gdp"));
        Gov.description = GovItem.GetValue ("description");

        Governments.Add (Gov);

        Debug.Log ("Loaded Government: " + GovItem.GetValue("name"));
      }

      Debug.Log ("Initialized Governments");
    }
コード例 #2
0
 public ViewGovernmentButton (Government Gov, Action <Government>callback) {
   this.Gov = Gov;
   this.callback = callback;
 }
コード例 #3
0
 private void SelectGovernment(Government Gov)
 {
     SelectedGovernment = Gov;
       GovernmentDescription.label = Gov.description;
       GovernmentGameplayDescription.label = Gov.GetGameplayDescription();
       Confirm.text = "Select " + Gov.name;
 }
コード例 #4
0
 public ViewGovernmentButton(Government Gov, Action <Government> callback)
 {
     this.Gov      = Gov;
     this.callback = callback;
 }