/** * Getter functions. * Used as a safety measure for null checking * (But ideally should not enter the null check condition). **/ public SoldierHistoryManager GetSoldierHistory() { if (this.soldierHistory == null) { this.soldierHistory = GetComponentInChildren <SoldierHistoryManager>(); } return(this.soldierHistory); }
public void ShowSoldierHistories(bool val) { foreach (Soldier s in soldiers) { SoldierHistoryManager histManager = s.GetSoldierHistory(); histManager.ShowHistoryPanel(val); } }
public void ClearSoldierHistories() { foreach (Soldier s in soldiers) { SoldierHistoryManager histManager = s.GetSoldierHistory(); histManager.ClearHistories(); } }
public void InitializeComponents() { if (parent == null) { parent = GetComponentInParent <SoldierHistoryManager>(); } // Team Components if (textTeamLead == null) { textTeamLead = GetComponentInChildren <TextMeshTeamLeadObjectMarker>(); } if (textTeamAssist == null) { textTeamAssist = GetComponentInChildren <TextMeshTeamAssistObjectMarker>(); } //if (teamWinLogo == null) // teamWinLogo = GetComponentInChildren<TeamWinObjectMarker>(); // Target Components if (textTargetLead == null) { textTargetLead = GetComponentInChildren <TextMeshTargetLeadObjectMarker>(); } if (textTargetAssist == null) { textTargetAssist = GetComponentInChildren <TextMeshTargetAssistObjectMarker>(); } //if (targetWinLogo == null) // targetWinLogo = GetComponentInChildren<TargetWinObjectMarker>(); // Rule Marker Components GameObject frontModel = null, backModel = null; foreach (Transform t in transform) { if (t.name.Equals("Models Front")) { frontModel = t.gameObject; } else if (t.name.Equals("Models Reverse")) { backModel = t.gameObject; } } // Front Models if (frontModel != null) { if (ruleHighFront == null) { ruleHighFront = frontModel.GetComponentInChildren <HighRuleObjectMarker>(); } if (ruleLowFront == null) { ruleLowFront = frontModel.GetComponentInChildren <LowRuleObjectMarker>(); } } else { Debug.LogError("Failed to Initialize Soldier History Models"); } // Back Models if (backModel != null) { if (ruleHighBack == null) { ruleHighBack = backModel.GetComponentInChildren <HighRuleObjectMarker>(); } if (ruleLowBack == null) { ruleLowBack = backModel.GetComponentInChildren <LowRuleObjectMarker>(); } } else { Debug.LogError("Failed to Initialize Soldier History Models"); } }