public void ChangeTeamMateButtonFace(TeamMate teamMate, TeamMateMood mood) { int index = (int)teamMate.TMClass; TeamMateButton tmb = teamMateButtons[index] as TeamMateButton; tmb.SetButtonImageFromMood(mood); }
// Start is called before the first frame update void Start() { SetBossHealthSlider(1f); //Set the player's button image. It won't have any other functionality PlayerHealerButton.faceReferences = TeammateFacesList[TeammateFacesList.Count - 1]; PlayerHealerButton.SetButtonImageFromMood(TeamMateMood.NEUTRAL); for (int s = 0; s < TOTAL_SKILLS; s++) { SkillButton skillButton = Instantiate(skillButtonPrefab); skillButton.transform.SetParent(skillButtonParent, false); skillButton.skill = gameController.Healer.GetSkillByType((SkillType)s); skillButton.playerHealerButton = PlayerHealerButton; skillButton.InitButton(s); skillButtons.Add(skillButton); int index = s; //Need to manually seperate the index skillButton.uiButton.onClick.AddListener(delegate { OnSkillButtonPressed(index); }); } for (int t = 0, count = gameController.TeamMates.Count; t < count; t++) { TeamMateButton tmButton = Instantiate(teamMateButtonPrefab); tmButton.transform.SetParent(teamMateButtonParent, false); tmButton.teamMate = gameController.TeamMates[t]; tmButton.faceReferences = TeammateFacesList[t]; tmButton.InitButton(t); teamMateButtons.Add(tmButton); int index = t; //Need to manually seperate the index tmButton.uiButton.onClick.AddListener(delegate { OnTeamMateButtonPressed(index); }); } WinScreen.SetActive(false); LoseScreen.SetActive(false); }