// Update is called once per frame void Update() { for (int i = 0; i < factionMat.Length; i++) { MenuUI facButt = factionButton.GetComponent <MenuUI>(); if (facButt.GetFactionNow() == i) { factionButton.GetComponent <Renderer>().material = factionMat[i]; } } TextMesh teamText = teamButton.GetComponent <TextMesh>(); MenuUI teamUI = teamButton.GetComponent <MenuUI>(); int teamPresent = teamUI.GetTeamNow() + 1; teamText.text = "" + teamPresent; MenuUI addUI = addButton.GetComponent <MenuUI>(); TextMesh addText = addButton.GetComponent <TextMesh>(); string addNow = addUI.GetAvalibleNow() ? "-" : "+"; addText.text = addNow; playerAvalible = addUI.GetAvalibleNow(); foreach (Transform child in this.transform) { if (child != addButton.transform) { child.gameObject.SetActive(addUI.GetAvalibleNow()); } } }
public int GetTeam() { MenuUI teamUI = teamButton.GetComponent <MenuUI>(); return(teamUI.GetTeamNow()); }