private void Initialization()
{
string[] teamLabels = {
"Yellow Team", "Blue Team"
};
if (this.teamMetrics == null) {
this.teamMetrics = new List<TeamMetric>();
}
for (int i = 0; i < teamLabels.Length; i++) {
if (this.teamMetrics.Count < teamLabels.Length) {
TeamMetric metric = new TeamMetric();
//Integers
metric.levelDifficulty = -1;
metric.numberOfAttacks = 0;
metric.numberOfDeaths = 0;
metric.numberOfKills = 0;
metric.numberOfMerges = 0;
metric.numberOfSplits = 0;
metric.winCount = 0;
metric.lossCount = 0;
//Floats
metric.totalGameTimeSinceEpoch = 0f;
metric.totalGameTime = 0f;
metric.totalBattleEngagementTime = 0f;
metric.totalAttackTime = 0f;
//Strings
metric.teamName = teamLabels[i];
metric.difficultyEquations = "N/A (Not used.)";
this.teamMetrics.Add(metric);
}
else {
ResetMetric(teamLabels[i], i);
}
}
//Flags and class members
this.outputField = this.GetComponentInChildren<InputField>();
this.outputField.readOnly = true;
if (this.stringBuilder == null) {
this.stringBuilder = new StringBuilder();
}
else {
this.stringBuilder.Length = 0;
}
this.gameMetricsLogGroup = this.GetComponent<CanvasGroup>();
this.simulationMetricsLoggerStart = false;
this.gameStartFlag = false;
this.isInputEnabled = false;
this.simulationManager = GameObject.FindObjectOfType<SimulationManager>();
if (this.simulationManager == null) {
Debug.LogError("Couldn't find simulation manager.");
}
//Canvas Group
DisableCanvasGroup();
}