void DisplayPoints() { //Player 1 points P1Data.GetComponentInChildren <Text>(kills).text = PointsStorage.P.P1Points[PointsStorage.P.kills].ToString(); P1Data.GetComponentInChildren <Text>(builds).text = PointsStorage.P.P1Points[PointsStorage.P.builds].ToString(); P1Data.GetComponentInChildren <Text>(points).text = PointsStorage.P.P1Points[PointsStorage.P.total].ToString(); P1Data.GetComponentInChildren <Text>(wins).text = PointsStorage.P.P1Points[PointsStorage.P.wins].ToString(); //Player 2 points P2Data.GetComponentInChildren <Text>(kills).text = PointsStorage.P.P2Points[PointsStorage.P.kills].ToString(); P2Data.GetComponentInChildren <Text>(builds).text = PointsStorage.P.P2Points[PointsStorage.P.builds].ToString(); P2Data.GetComponentInChildren <Text>(points).text = PointsStorage.P.P2Points[PointsStorage.P.total].ToString(); P2Data.GetComponentInChildren <Text>(wins).text = PointsStorage.P.P2Points[PointsStorage.P.wins].ToString(); if (P3) { //Player 3 points P3Data.GetComponentInChildren <Text>(kills).text = PointsStorage.P.P3Points[PointsStorage.P.kills].ToString(); P3Data.GetComponentInChildren <Text>(builds).text = PointsStorage.P.P3Points[PointsStorage.P.builds].ToString(); P3Data.GetComponentInChildren <Text>(points).text = PointsStorage.P.P3Points[PointsStorage.P.total].ToString(); P3Data.GetComponentInChildren <Text>(wins).text = PointsStorage.P.P3Points[PointsStorage.P.wins].ToString(); if (P4) { //Player 4 points P4Data.GetComponentInChildren <Text>(kills).text = PointsStorage.P.P4Points[PointsStorage.P.kills].ToString(); P4Data.GetComponentInChildren <Text>(builds).text = PointsStorage.P.P4Points[PointsStorage.P.builds].ToString(); P4Data.GetComponentInChildren <Text>(points).text = PointsStorage.P.P4Points[PointsStorage.P.total].ToString(); P4Data.GetComponentInChildren <Text>(wins).text = PointsStorage.P.P4Points[PointsStorage.P.wins].ToString(); } } }
void DisablePlayer4() { P4Data.GetComponentInChildren <Image>(title).enabled = false; P4Data.GetComponentInChildren <Text>(kills).text = ""; P4Data.GetComponentInChildren <Text>(builds).text = ""; P4Data.GetComponentInChildren <Text>(points).text = ""; P4Data.GetComponentInChildren <Text>(wins).text = ""; P4Data.GetComponent <Image>().color = Color.gray; P4 = false; }
void Awake() { //Assigns appropriate player color to panels P1Data.GetComponent <Image>().color = P1_Color.color; P2Data.GetComponent <Image>().color = P2_Color.color; P3Data.GetComponent <Image>().color = P3_Color.color; P4Data.GetComponent <Image>().color = P4_Color.color; CheckPlayerNumbers(); playerPoints = new int[4]; //Debug.Log(playerPoints.Length); playerPoints[0] = PointsStorageTest.T.P1Points[PointsStorageTest.T.total]; playerPoints[1] = PointsStorageTest.T.P2Points[PointsStorageTest.T.total]; playerPoints[2] = PointsStorageTest.T.P3Points[PointsStorageTest.T.total]; playerPoints[3] = PointsStorageTest.T.P4Points[PointsStorageTest.T.total]; playerImages = new Image[4]; playerImages[0] = P1Data.GetComponentInChildren <Image>(title); playerImages[1] = P2Data.GetComponentInChildren <Image>(title); playerImages[2] = P3Data.GetComponentInChildren <Image>(title); playerImages[3] = P4Data.GetComponentInChildren <Image>(title); playerFaces = new Sprite[4][]; playerFaces[0] = P1Faces; playerFaces[1] = P2Faces; playerFaces[2] = P3Faces; playerFaces[3] = P4Faces; playerName = new string[4]; playerName[0] = "Player 1"; playerName[1] = "Player 2"; playerName[2] = "Player 3"; playerName[3] = "Player 4"; continueButton.text = "Start round " + (PointsStorageTest.T.round + 1); roundDisplay.text = "Round " + (PointsStorageTest.T.round) + " Results"; P1Crown.gameObject.SetActive(false); P2Crown.gameObject.SetActive(false); P3Crown.gameObject.SetActive(false); P4Crown.gameObject.SetActive(false); }
void Awake() { //Assigns appropriate player color to panels P1Data.GetComponent <Image>().color = P1_Color.color; P2Data.GetComponent <Image>().color = P2_Color.color; P3Data.GetComponent <Image>().color = P3_Color.color; P4Data.GetComponent <Image>().color = P4_Color.color; CheckPlayerNumbers(); playerPoints = new int[players]; playerPoints[0] = PointsStorage.P.P1Points[PointsStorage.P.total]; playerPoints[1] = PointsStorage.P.P2Points[PointsStorage.P.total]; playerImages = new Image[players]; playerImages[0] = P1Data.GetComponentInChildren <Image>(title); playerImages[1] = P2Data.GetComponentInChildren <Image>(title); playerFaces = new Sprite[players][]; playerFaces[0] = P1Faces; playerFaces[1] = P2Faces; playerName = new string[players]; playerName[0] = "Player 1"; playerName[1] = "Player 2"; if (P3) { playerFaces[2] = P3Faces; playerPoints[2] = PointsStorage.P.P3Points[PointsStorage.P.total]; playerImages[2] = P3Data.GetComponentInChildren <Image>(title); playerName[2] = "Player 3"; } if (P4) { playerFaces[3] = P4Faces; playerPoints[3] = PointsStorage.P.P4Points[PointsStorage.P.total]; playerImages[3] = P4Data.GetComponentInChildren <Image>(title); playerName[3] = "Player 4"; } }