/// <summary> /// Instantiates the next battle. /// </summary> private void LoadNextBattle() { //Create new battle gameobject. this.battleObject = (GameObject)Instantiate(this.BattlePrefab); this.battleObject.GetComponent<BattleScript>().Battle = this.scenario.Battles[0]; //Create new battle report and set the object to record data there. BattleReport report = new BattleReport(); this.battleObject.GetComponent<BattleScript>().Report = report; //Set the initial score. this.battleObject.GetComponent<BattleScript>().Score = this.score; //Update lists. this.scenario.Battles.RemoveAt(0); this.battleReports.Add(report); }
/// <summary> /// Instantiates the next battle. /// </summary> private void LoadBattle() { //Create new battle gameobject. this.battleObject = (GameObject)Instantiate(this.BattlePrefab); this.battleObject.GetComponent<BattleScript>().Battle = Globals.Instance.Battle; BattleScript bScript = this.battleObject.GetComponent<BattleScript>(); //Set the initial score. bScript.Score = Globals.Instance.Score; //Create new battle report and set the object to record data there. BattleReport report = new BattleReport(); bScript.Report = report; Globals.Instance.Reports.Add(report); //Set the delegate method if applicable. if (this.UseServerAgents) bScript.AITurnDelegate = this.AFABLTurn; }