using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class GameStatusChecker : MonoBehaviour { Color MyWhite = Color.white; Color MyRed = new Color(255 / 255f, 15 / 255f, 15 / 255f); Color MyOrange = new Color(255 / 255f, 111 / 255f, 15 / 255f); Color MyYellow = new Color(255 / 255f, 255 / 255f, 15 / 255f); Color MyLime = new Color(13 / 255f, 222 / 255f, 13 / 255f); Color MyGreen = new Color(6 / 255f, 105 / 255f, 6 / 255f); Color MyLightBlue = new Color(13 / 255f, 170 / 255f, 222 / 255f); Color MyBlue = new Color(13 / 255f, 100 / 255f, 222 / 255f); Color MyPink = new Color(235 / 255f, 14 / 255f, 143 / 255f); Color MyPurple = new Color(152 / 255f, 13 / 255f, 222 / 255f); public Text GameStatusText; public Text UserScore; string UserName; public Text[] UserScoresRank = new Text[5]; public Button[] MyDestinations = new Button[49]; public Image[] MyLights = new Image[49]; public Text MainNumber; private int[] DesStatus = new int[49]; private void Start() { GameStatusText.enabled = false; } public bool GameStatus() { CheckAndSetDes(); if (ReturnGameStatusFinished() == true) { return false; } else { return true; } } private void CheckAndSetDes() { for (int i = 0; i < 48; i++) { if (MyLights[i].color == MyWhite) { if (i == 0) { CheckAndSetTwoSideDes(i + 1, i + 7 , i); } if (i == 6) { CheckAndSetTwoSideDes(i - 1, i + 7, i); } if (i == 42) { CheckAndSetTwoSideDes(i - 7, i + 1, i); } if (i == 48) { CheckAndSetTwoSideDes(i - 7, i - 1, i); } if (i >= 1 && i <= 5) { CheckAndSetThreeSideDes(i - 1, i + 1, i + 7, i); } if (i == 7 || i == 14 || i == 21 || i == 28 || i == 35) { CheckAndSetThreeSideDes(i - 7, i + 1, i + 7, i); } if (i == 13 || i == 20 || i == 27 || i == 34 || i == 41) { CheckAndSetThreeSideDes(i - 7, i - 1, i + 7, i); } if (i >= 43 && i <= 47) { CheckAndSetThreeSideDes(i - 1, i - 7, i + 1, i); } if ((i >= 8 && i <= 12) || (i >= 15 && i <= 19) || (i >= 22 && i <= 26) || (i >= 29 && i <= 33) || (i >= 36 && i <= 40)) { CheckAndSetFourSideDes(i - 1, i + 7, i + 1, i + 7, i); } } else { DesStatus[i] = 1; } } } private void CheckAndSetTwoSideDes(int FirstTile , int SecondTile , int MyMainNumber) { if ((MainNumber.color == MyRed) && (MyLights[FirstTile].color == MyLime || MyLights[FirstTile].color == MyGreen || MyLights[FirstTile].color == MyLightBlue || MyLights[FirstTile].color == MyBlue || MyLights[FirstTile].color == MyPink || MyLights[FirstTile].color == MyPurple || MyLights[SecondTile].color == MyLime || MyLights[SecondTile].color == MyGreen || MyLights[SecondTile].color == MyLightBlue || MyLights[SecondTile].color == MyBlue || MyLights[SecondTile].color == MyPink || MyLights[SecondTile].color == MyPurple)) { MyDestinations[MyMainNumber].GetComponentInChildren().text = "1"; MyDestinations[MyMainNumber].GetComponentInChildren().color = MyWhite; MyLights[MyMainNumber].color = MyWhite; } else { MyDestinations[MyMainNumber].GetComponentInChildren().text = string.Empty; MyDestinations[MyMainNumber].GetComponentInChildren().color = MyWhite; MyLights[MyMainNumber].color = MyWhite; } if ((MainNumber.color == MyOrange) && (MyLights[FirstTile].color == MyLime || MyLights[FirstTile].color == MyGreen || MyLights[FirstTile].color == MyLightBlue || MyLights[FirstTile].color == MyBlue || MyLights[FirstTile].color == MyPink || MyLights[FirstTile].color == MyPurple || MyLights[SecondTile].color == MyLime || MyLights[SecondTile].color == MyGreen || MyLights[SecondTile].color == MyLightBlue || MyLights[SecondTile].color == MyBlue || MyLights[SecondTile].color == MyPink || MyLights[SecondTile].color == MyPurple)) { MyDestinations[MyMainNumber].GetComponentInChildren().text = "1"; MyDestinations[MyMainNumber].GetComponentInChildren().color = MyWhite; MyLights[MyMainNumber].color = MyWhite; } else { MyDestinations[MyMainNumber].GetComponentInChildren().text = string.Empty; MyDestinations[MyMainNumber].GetComponentInChildren().color = MyWhite; MyLights[MyMainNumber].color = MyWhite; } if ((MainNumber.color == MyYellow) && (MyLights[FirstTile].color == MyGreen || MyLights[FirstTile].color == MyLightBlue || MyLights[FirstTile].color == MyBlue || MyLights[FirstTile].color == MyPink || MyLights[FirstTile].color == MyPurple || MyLights[SecondTile].color == MyGreen || MyLights[SecondTile].color == MyLightBlue || MyLights[SecondTile].color == MyBlue || MyLights[SecondTile].color == MyPink || MyLights[SecondTile].color == MyPurple)) { MyDestinations[MyMainNumber].GetComponentInChildren().text = "1"; MyDestinations[MyMainNumber].GetComponentInChildren().color = MyWhite; MyLights[MyMainNumber].color = MyWhite; } else { MyDestinations[MyMainNumber].GetComponentInChildren().text = string.Empty; MyDestinations[MyMainNumber].GetComponentInChildren().color = MyWhite; MyLights[MyMainNumber].color = MyWhite; } if ((MainNumber.color == MyLime) && (MyLights[FirstTile].color == MyRed || MyLights[FirstTile].color == MyOrange || MyLights[FirstTile].color == MyYellow || MyLights[FirstTile].color == MyBlue || MyLights[FirstTile].color == MyPink || MyLights[FirstTile].color == MyPurple || MyLights[SecondTile].color == MyRed || MyLights[SecondTile].color == MyOrange || MyLights[SecondTile].color == MyYellow || MyLights[SecondTile].color == MyBlue || MyLights[SecondTile].color == MyPink || MyLights[SecondTile].color == MyPurple)) { MyDestinations[MyMainNumber].GetComponentInChildren().text = "1"; MyDestinations[MyMainNumber].GetComponentInChildren().color = MyWhite; MyLights[MyMainNumber].color = MyWhite; } else { MyDestinations[MyMainNumber].GetComponentInChildren().text = string.Empty; MyDestinations[MyMainNumber].GetComponentInChildren().color = MyWhite; MyLights[MyMainNumber].color = MyWhite; } if ((MainNumber.color == MyGreen) && (MyLights[FirstTile].color == MyRed || MyLights[FirstTile].color == MyOrange || MyLights[FirstTile].color == MyPink || MyLights[FirstTile].color == MyPurple || MyLights[SecondTile].color == MyRed || MyLights[SecondTile].color == MyOrange || MyLights[SecondTile].color == MyPink || MyLights[SecondTile].color == MyPurple)) { MyDestinations[MyMainNumber].GetComponentInChildren().text = "1"; MyDestinations[MyMainNumber].GetComponentInChildren().color = MyWhite; MyLights[MyMainNumber].color = MyWhite; } else { MyDestinations[MyMainNumber].GetComponentInChildren().text = string.Empty; MyDestinations[MyMainNumber].GetComponentInChildren().color = MyWhite; MyLights[MyMainNumber].color = MyWhite; } if ((MainNumber.color == MyLightBlue) && (MyLights[FirstTile].color == MyRed || MyLights[FirstTile].color == MyOrange || MyLights[FirstTile].color == MyYellow || MyLights[FirstTile].color == MyLime || MyLights[FirstTile].color == MyPink || MyLights[FirstTile].color == MyPurple || MyLights[SecondTile].color == MyRed || MyLights[SecondTile].color == MyOrange || MyLights[SecondTile].color == MyYellow || MyLights[SecondTile].color == MyLime || MyLights[SecondTile].color == MyPink || MyLights[SecondTile].color == MyPurple)) { MyDestinations[MyMainNumber].GetComponentInChildren().text = "1"; MyDestinations[MyMainNumber].GetComponentInChildren().color = MyWhite; MyLights[MyMainNumber].color = MyWhite; } else { MyDestinations[MyMainNumber].GetComponentInChildren().text = string.Empty; MyDestinations[MyMainNumber].GetComponentInChildren().color = MyWhite; MyLights[MyMainNumber].color = MyWhite; } if ((MainNumber.color == MyBlue) && (MyLights[FirstTile].color == MyRed || MyLights[FirstTile].color == MyOrange || MyLights[FirstTile].color == MyYellow || MyLights[FirstTile].color == MyLime || MyLights[FirstTile].color == MyGreen || MyLights[SecondTile].color == MyRed || MyLights[SecondTile].color == MyOrange || MyLights[SecondTile].color == MyYellow || MyLights[SecondTile].color == MyLime || MyLights[SecondTile].color == MyGreen)) { MyDestinations[MyMainNumber].GetComponentInChildren().text = "1"; MyDestinations[MyMainNumber].GetComponentInChildren().color = MyWhite; MyLights[MyMainNumber].color = MyWhite; } else { MyDestinations[MyMainNumber].GetComponentInChildren().text = string.Empty; MyDestinations[MyMainNumber].GetComponentInChildren().color = MyWhite; MyLights[MyMainNumber].color = MyWhite; } if ((MainNumber.color == MyPink) && (MyLights[FirstTile].color == MyRed || MyLights[FirstTile].color == MyOrange || MyLights[FirstTile].color == MyYellow || MyLights[FirstTile].color == MyLime || MyLights[FirstTile].color == MyLightBlue || MyLights[FirstTile].color == MyGreen || MyLights[SecondTile].color == MyRed || MyLights[SecondTile].color == MyOrange || MyLights[SecondTile].color == MyYellow || MyLights[SecondTile].color == MyLime || MyLights[SecondTile].color == MyLightBlue || MyLights[SecondTile].color == MyGreen)) { MyDestinations[MyMainNumber].GetComponentInChildren().text = "1"; MyDestinations[MyMainNumber].GetComponentInChildren().color = MyWhite; MyLights[MyMainNumber].color = MyWhite; } else { MyDestinations[MyMainNumber].GetComponentInChildren().text = string.Empty; MyDestinations[MyMainNumber].GetComponentInChildren().color = MyWhite; MyLights[MyMainNumber].color = MyWhite; } if ((MainNumber.color == MyPurple) && (MyLights[FirstTile].color == MyRed || MyLights[FirstTile].color == MyOrange || MyLights[FirstTile].color == MyYellow || MyLights[FirstTile].color == MyLime || MyLights[FirstTile].color == MyLightBlue || MyLights[FirstTile].color == MyGreen || MyLights[SecondTile].color == MyRed || MyLights[SecondTile].color == MyOrange || MyLights[SecondTile].color == MyYellow || MyLights[SecondTile].color == MyLime || MyLights[SecondTile].color == MyLightBlue || MyLights[SecondTile].color == MyGreen)) { MyDestinations[MyMainNumber].GetComponentInChildren().text = "1"; MyDestinations[MyMainNumber].GetComponentInChildren().color = MyWhite; MyLights[MyMainNumber].color = MyWhite; } else { MyDestinations[MyMainNumber].GetComponentInChildren().text = string.Empty; MyDestinations[MyMainNumber].GetComponentInChildren().color = MyWhite; MyLights[MyMainNumber].color = MyWhite; } } private void CheckAndSetThreeSideDes(int FirstTile , int SecondTile , int ThirdTile, int MyMainNumber) { if ((MainNumber.color == MyRed) && (MyLights[FirstTile].color == MyLime || MyLights[FirstTile].color == MyGreen || MyLights[FirstTile].color == MyLightBlue || MyLights[FirstTile].color == MyBlue || MyLights[FirstTile].color == MyPink || MyLights[FirstTile].color == MyPurple || MyLights[SecondTile].color == MyLime || MyLights[SecondTile].color == MyGreen || MyLights[SecondTile].color == MyLightBlue || MyLights[SecondTile].color == MyBlue || MyLights[SecondTile].color == MyPink || MyLights[SecondTile].color == MyPurple || MyLights[ThirdTile].color == MyLime || MyLights[ThirdTile].color == MyGreen || MyLights[ThirdTile].color == MyLightBlue || MyLights[ThirdTile].color == MyBlue || MyLights[ThirdTile].color == MyPink || MyLights[ThirdTile].color == MyPurple)) { MyDestinations[MyMainNumber].GetComponentInChildren().text = "1"; MyDestinations[MyMainNumber].GetComponentInChildren().color = MyWhite; MyLights[MyMainNumber].color = MyWhite; } else { MyDestinations[MyMainNumber].GetComponentInChildren().text = string.Empty; MyDestinations[MyMainNumber].GetComponentInChildren().color = MyWhite; MyLights[MyMainNumber].color = MyWhite; } if ((MainNumber.color == MyOrange) && (MyLights[FirstTile].color == MyLime || MyLights[FirstTile].color == MyGreen || MyLights[FirstTile].color == MyLightBlue || MyLights[FirstTile].color == MyBlue || MyLights[FirstTile].color == MyPink || MyLights[FirstTile].color == MyPurple || MyLights[SecondTile].color == MyLime || MyLights[SecondTile].color == MyGreen || MyLights[SecondTile].color == MyLightBlue || MyLights[SecondTile].color == MyBlue || MyLights[SecondTile].color == MyPink || MyLights[SecondTile].color == MyPurple || MyLights[ThirdTile].color == MyLime || MyLights[ThirdTile].color == MyGreen || MyLights[ThirdTile].color == MyLightBlue || MyLights[ThirdTile].color == MyBlue || MyLights[ThirdTile].color == MyPink || MyLights[ThirdTile].color == MyPurple)) { MyDestinations[MyMainNumber].GetComponentInChildren().text = "1"; MyDestinations[MyMainNumber].GetComponentInChildren().color = MyWhite; MyLights[MyMainNumber].color = MyWhite; } else { MyDestinations[MyMainNumber].GetComponentInChildren().text = string.Empty; MyDestinations[MyMainNumber].GetComponentInChildren().color = MyWhite; MyLights[MyMainNumber].color = MyWhite; } if ((MainNumber.color == MyYellow) && (MyLights[FirstTile].color == MyGreen || MyLights[FirstTile].color == MyLightBlue || MyLights[FirstTile].color == MyBlue || MyLights[FirstTile].color == MyPink || MyLights[FirstTile].color == MyPurple || MyLights[SecondTile].color == MyGreen || MyLights[SecondTile].color == MyLightBlue || MyLights[SecondTile].color == MyBlue || MyLights[SecondTile].color == MyPink || MyLights[SecondTile].color == MyPurple || MyLights[ThirdTile].color == MyGreen || MyLights[ThirdTile].color == MyLightBlue || MyLights[ThirdTile].color == MyBlue || MyLights[ThirdTile].color == MyPink || MyLights[ThirdTile].color == MyPurple )) { MyDestinations[MyMainNumber].GetComponentInChildren().text = "1"; MyDestinations[MyMainNumber].GetComponentInChildren().color = MyWhite; MyLights[MyMainNumber].color = MyWhite; } else { MyDestinations[MyMainNumber].GetComponentInChildren().text = string.Empty; MyDestinations[MyMainNumber].GetComponentInChildren().color = MyWhite; MyLights[MyMainNumber].color = MyWhite; } if ((MainNumber.color == MyLime) && (MyLights[FirstTile].color == MyRed || MyLights[FirstTile].color == MyOrange || MyLights[FirstTile].color == MyYellow || MyLights[FirstTile].color == MyBlue || MyLights[FirstTile].color == MyPink || MyLights[FirstTile].color == MyPurple || MyLights[SecondTile].color == MyRed || MyLights[SecondTile].color == MyOrange || MyLights[SecondTile].color == MyYellow || MyLights[SecondTile].color == MyBlue || MyLights[SecondTile].color == MyPink || MyLights[SecondTile].color == MyPurple || MyLights[ThirdTile].color == MyRed || MyLights[ThirdTile].color == MyOrange || MyLights[ThirdTile].color == MyYellow || MyLights[ThirdTile].color == MyBlue || MyLights[ThirdTile].color == MyPink || MyLights[ThirdTile].color == MyPurple)) { MyDestinations[MyMainNumber].GetComponentInChildren().text = "1"; MyDestinations[MyMainNumber].GetComponentInChildren().color = MyWhite; MyLights[MyMainNumber].color = MyWhite; } else { MyDestinations[MyMainNumber].GetComponentInChildren().text = string.Empty; MyDestinations[MyMainNumber].GetComponentInChildren().color = MyWhite; MyLights[MyMainNumber].color = MyWhite; } if ((MainNumber.color == MyGreen) && (MyLights[FirstTile].color == MyRed || MyLights[FirstTile].color == MyOrange || MyLights[FirstTile].color == MyPink || MyLights[FirstTile].color == MyPurple || MyLights[SecondTile].color == MyRed || MyLights[SecondTile].color == MyOrange || MyLights[SecondTile].color == MyPink || MyLights[SecondTile].color == MyPurple || MyLights[ThirdTile].color == MyRed || MyLights[ThirdTile].color == MyOrange || MyLights[ThirdTile].color == MyPink || MyLights[ThirdTile].color == MyPurple)) { MyDestinations[MyMainNumber].GetComponentInChildren().text = "1"; MyDestinations[MyMainNumber].GetComponentInChildren().color = MyWhite; MyLights[MyMainNumber].color = MyWhite; } else { MyDestinations[MyMainNumber].GetComponentInChildren().text = string.Empty; MyDestinations[MyMainNumber].GetComponentInChildren().color = MyWhite; MyLights[MyMainNumber].color = MyWhite; } if ((MainNumber.color == MyLightBlue) && (MyLights[FirstTile].color == MyRed || MyLights[FirstTile].color == MyOrange || MyLights[FirstTile].color == MyYellow || MyLights[FirstTile].color == MyLime || MyLights[FirstTile].color == MyPink || MyLights[FirstTile].color == MyPurple || MyLights[SecondTile].color == MyRed || MyLights[SecondTile].color == MyOrange || MyLights[SecondTile].color == MyYellow || MyLights[SecondTile].color == MyLime || MyLights[SecondTile].color == MyPink || MyLights[SecondTile].color == MyPurple || MyLights[ThirdTile].color == MyRed || MyLights[ThirdTile].color == MyOrange || MyLights[ThirdTile].color == MyYellow || MyLights[ThirdTile].color == MyLime || MyLights[ThirdTile].color == MyPink || MyLights[ThirdTile].color == MyPurple)) { MyDestinations[MyMainNumber].GetComponentInChildren().text = "1"; MyDestinations[MyMainNumber].GetComponentInChildren().color = MyWhite; MyLights[MyMainNumber].color = MyWhite; } else { MyDestinations[MyMainNumber].GetComponentInChildren().text = string.Empty; MyDestinations[MyMainNumber].GetComponentInChildren().color = MyWhite; MyLights[MyMainNumber].color = MyWhite; } if ((MainNumber.color == MyBlue) && (MyLights[FirstTile].color == MyRed || MyLights[FirstTile].color == MyOrange || MyLights[FirstTile].color == MyYellow || MyLights[FirstTile].color == MyLime || MyLights[FirstTile].color == MyGreen || MyLights[SecondTile].color == MyRed || MyLights[SecondTile].color == MyOrange || MyLights[SecondTile].color == MyYellow || MyLights[SecondTile].color == MyLime || MyLights[SecondTile].color == MyGreen || MyLights[ThirdTile].color == MyRed || MyLights[ThirdTile].color == MyOrange || MyLights[ThirdTile].color == MyYellow || MyLights[ThirdTile].color == MyLime || MyLights[ThirdTile].color == MyGreen)) { MyDestinations[MyMainNumber].GetComponentInChildren().text = "1"; MyDestinations[MyMainNumber].GetComponentInChildren().color = MyWhite; MyLights[MyMainNumber].color = MyWhite; } else { MyDestinations[MyMainNumber].GetComponentInChildren().text = string.Empty; MyDestinations[MyMainNumber].GetComponentInChildren().color = MyWhite; MyLights[MyMainNumber].color = MyWhite; } if ((MainNumber.color == MyPink) && (MyLights[FirstTile].color == MyRed || MyLights[FirstTile].color == MyOrange || MyLights[FirstTile].color == MyYellow || MyLights[FirstTile].color == MyLime || MyLights[FirstTile].color == MyLightBlue || MyLights[FirstTile].color == MyGreen || MyLights[SecondTile].color == MyRed || MyLights[SecondTile].color == MyOrange || MyLights[SecondTile].color == MyYellow || MyLights[SecondTile].color == MyLime || MyLights[SecondTile].color == MyLightBlue || MyLights[SecondTile].color == MyGreen || MyLights[ThirdTile].color == MyRed || MyLights[ThirdTile].color == MyOrange || MyLights[ThirdTile].color == MyYellow || MyLights[ThirdTile].color == MyLime || MyLights[ThirdTile].color == MyLightBlue || MyLights[ThirdTile].color == MyGreen)) { MyDestinations[MyMainNumber].GetComponentInChildren().text = "1"; MyDestinations[MyMainNumber].GetComponentInChildren().color = MyWhite; MyLights[MyMainNumber].color = MyWhite; } else { MyDestinations[MyMainNumber].GetComponentInChildren().text = string.Empty; MyDestinations[MyMainNumber].GetComponentInChildren().color = MyWhite; MyLights[MyMainNumber].color = MyWhite; } if ((MainNumber.color == MyPurple) && (MyLights[FirstTile].color == MyRed || MyLights[FirstTile].color == MyOrange || MyLights[FirstTile].color == MyYellow || MyLights[FirstTile].color == MyLime || MyLights[FirstTile].color == MyLightBlue || MyLights[FirstTile].color == MyGreen || MyLights[SecondTile].color == MyRed || MyLights[SecondTile].color == MyOrange || MyLights[SecondTile].color == MyYellow || MyLights[SecondTile].color == MyLime || MyLights[SecondTile].color == MyLightBlue || MyLights[SecondTile].color == MyGreen || MyLights[ThirdTile].color == MyRed || MyLights[ThirdTile].color == MyOrange || MyLights[ThirdTile].color == MyYellow || MyLights[ThirdTile].color == MyLime || MyLights[ThirdTile].color == MyLightBlue || MyLights[ThirdTile].color == MyGreen)) { MyDestinations[MyMainNumber].GetComponentInChildren().text = "1"; MyDestinations[MyMainNumber].GetComponentInChildren().color = MyWhite; MyLights[MyMainNumber].color = MyWhite; } else { MyDestinations[MyMainNumber].GetComponentInChildren().text = string.Empty; MyDestinations[MyMainNumber].GetComponentInChildren().color = MyWhite; MyLights[MyMainNumber].color = MyWhite; } } private void CheckAndSetFourSideDes(int FirstTile, int SecondTile, int ThirdTile , int FourthTile, int MyMainNumber) { if ((MainNumber.color == MyRed) && (MyLights[FirstTile].color == MyLime || MyLights[FirstTile].color == MyGreen || MyLights[FirstTile].color == MyLightBlue || MyLights[FirstTile].color == MyBlue || MyLights[FirstTile].color == MyPink || MyLights[FirstTile].color == MyPurple || MyLights[SecondTile].color == MyLime || MyLights[SecondTile].color == MyGreen || MyLights[SecondTile].color == MyLightBlue || MyLights[SecondTile].color == MyBlue || MyLights[SecondTile].color == MyPink || MyLights[SecondTile].color == MyPurple || MyLights[ThirdTile].color == MyLime || MyLights[ThirdTile].color == MyGreen || MyLights[ThirdTile].color == MyLightBlue || MyLights[ThirdTile].color == MyBlue || MyLights[ThirdTile].color == MyPink || MyLights[ThirdTile].color == MyPurple || MyLights[FourthTile].color == MyLime || MyLights[FourthTile].color == MyGreen || MyLights[FourthTile].color == MyLightBlue || MyLights[FourthTile].color == MyBlue || MyLights[FourthTile].color == MyPink || MyLights[FourthTile].color == MyPurple)) { MyDestinations[MyMainNumber].GetComponentInChildren().text = "1"; MyDestinations[MyMainNumber].GetComponentInChildren().color = MyWhite; MyLights[MyMainNumber].color = MyWhite; } else { MyDestinations[MyMainNumber].GetComponentInChildren().text = string.Empty; MyDestinations[MyMainNumber].GetComponentInChildren().color = MyWhite; MyLights[MyMainNumber].color = MyWhite; } if ((MainNumber.color == MyOrange) && (MyLights[FirstTile].color == MyLime || MyLights[FirstTile].color == MyGreen || MyLights[FirstTile].color == MyLightBlue || MyLights[FirstTile].color == MyBlue || MyLights[FirstTile].color == MyPink || MyLights[FirstTile].color == MyPurple || MyLights[SecondTile].color == MyLime || MyLights[SecondTile].color == MyGreen || MyLights[SecondTile].color == MyLightBlue || MyLights[SecondTile].color == MyBlue || MyLights[SecondTile].color == MyPink || MyLights[SecondTile].color == MyPurple || MyLights[ThirdTile].color == MyLime || MyLights[ThirdTile].color == MyGreen || MyLights[ThirdTile].color == MyLightBlue || MyLights[ThirdTile].color == MyBlue || MyLights[ThirdTile].color == MyPink || MyLights[ThirdTile].color == MyPurple || MyLights[FourthTile].color == MyLime || MyLights[FourthTile].color == MyGreen || MyLights[FourthTile].color == MyLightBlue || MyLights[FourthTile].color == MyBlue || MyLights[FourthTile].color == MyPink || MyLights[FourthTile].color == MyPurple)) { MyDestinations[MyMainNumber].GetComponentInChildren().text = "1"; MyDestinations[MyMainNumber].GetComponentInChildren().color = MyWhite; MyLights[MyMainNumber].color = MyWhite; } else { MyDestinations[MyMainNumber].GetComponentInChildren().text = string.Empty; MyDestinations[MyMainNumber].GetComponentInChildren().color = MyWhite; MyLights[MyMainNumber].color = MyWhite; } if ((MainNumber.color == MyYellow) && (MyLights[FirstTile].color == MyGreen || MyLights[FirstTile].color == MyLightBlue || MyLights[FirstTile].color == MyBlue || MyLights[FirstTile].color == MyPink || MyLights[FirstTile].color == MyPurple || MyLights[SecondTile].color == MyGreen || MyLights[SecondTile].color == MyLightBlue || MyLights[SecondTile].color == MyBlue || MyLights[SecondTile].color == MyPink || MyLights[SecondTile].color == MyPurple || MyLights[ThirdTile].color == MyGreen || MyLights[ThirdTile].color == MyLightBlue || MyLights[ThirdTile].color == MyBlue || MyLights[ThirdTile].color == MyPink || MyLights[ThirdTile].color == MyPurple || MyLights[FourthTile].color == MyGreen || MyLights[FourthTile].color == MyLightBlue || MyLights[FourthTile].color == MyBlue || MyLights[FourthTile].color == MyPink || MyLights[FourthTile].color == MyPurple)) { MyDestinations[MyMainNumber].GetComponentInChildren().text = "1"; MyDestinations[MyMainNumber].GetComponentInChildren().color = MyWhite; MyLights[MyMainNumber].color = MyWhite; } else { MyDestinations[MyMainNumber].GetComponentInChildren().text = string.Empty; MyDestinations[MyMainNumber].GetComponentInChildren().color = MyWhite; MyLights[MyMainNumber].color = MyWhite; } if ((MainNumber.color == MyLime) && (MyLights[FirstTile].color == MyRed || MyLights[FirstTile].color == MyOrange || MyLights[FirstTile].color == MyYellow || MyLights[FirstTile].color == MyBlue || MyLights[FirstTile].color == MyPink || MyLights[FirstTile].color == MyPurple || MyLights[SecondTile].color == MyRed || MyLights[SecondTile].color == MyOrange || MyLights[SecondTile].color == MyYellow || MyLights[SecondTile].color == MyBlue || MyLights[SecondTile].color == MyPink || MyLights[SecondTile].color == MyPurple || MyLights[ThirdTile].color == MyRed || MyLights[ThirdTile].color == MyOrange || MyLights[ThirdTile].color == MyYellow || MyLights[ThirdTile].color == MyBlue || MyLights[ThirdTile].color == MyPink || MyLights[ThirdTile].color == MyPurple || MyLights[FourthTile].color == MyRed || MyLights[FourthTile].color == MyOrange || MyLights[FourthTile].color == MyYellow || MyLights[FourthTile].color == MyBlue || MyLights[FourthTile].color == MyPink || MyLights[FourthTile].color == MyPurple)) { MyDestinations[MyMainNumber].GetComponentInChildren().text = "1"; MyDestinations[MyMainNumber].GetComponentInChildren().color = MyWhite; MyLights[MyMainNumber].color = MyWhite; } else { MyDestinations[MyMainNumber].GetComponentInChildren().text = string.Empty; MyDestinations[MyMainNumber].GetComponentInChildren().color = MyWhite; MyLights[MyMainNumber].color = MyWhite; } if ((MainNumber.color == MyGreen) && (MyLights[FirstTile].color == MyRed || MyLights[FirstTile].color == MyOrange || MyLights[FirstTile].color == MyPink || MyLights[FirstTile].color == MyPurple || MyLights[SecondTile].color == MyRed || MyLights[SecondTile].color == MyOrange || MyLights[SecondTile].color == MyPink || MyLights[SecondTile].color == MyPurple || MyLights[ThirdTile].color == MyRed || MyLights[ThirdTile].color == MyOrange || MyLights[ThirdTile].color == MyPink || MyLights[ThirdTile].color == MyPurple || MyLights[FourthTile].color == MyRed || MyLights[FourthTile].color == MyOrange || MyLights[FourthTile].color == MyPink || MyLights[FourthTile].color == MyPurple)) { MyDestinations[MyMainNumber].GetComponentInChildren().text = "1"; MyDestinations[MyMainNumber].GetComponentInChildren().color = MyWhite; MyLights[MyMainNumber].color = MyWhite; } else { MyDestinations[MyMainNumber].GetComponentInChildren().text = string.Empty; MyDestinations[MyMainNumber].GetComponentInChildren().color = MyWhite; MyLights[MyMainNumber].color = MyWhite; } if ((MainNumber.color == MyLightBlue) && (MyLights[FirstTile].color == MyRed || MyLights[FirstTile].color == MyOrange || MyLights[FirstTile].color == MyYellow || MyLights[FirstTile].color == MyLime || MyLights[FirstTile].color == MyPink || MyLights[FirstTile].color == MyPurple || MyLights[SecondTile].color == MyRed || MyLights[SecondTile].color == MyOrange || MyLights[SecondTile].color == MyYellow || MyLights[SecondTile].color == MyLime || MyLights[SecondTile].color == MyPink || MyLights[SecondTile].color == MyPurple || MyLights[ThirdTile].color == MyRed || MyLights[ThirdTile].color == MyOrange || MyLights[ThirdTile].color == MyYellow || MyLights[ThirdTile].color == MyLime || MyLights[ThirdTile].color == MyPink || MyLights[ThirdTile].color == MyPurple || MyLights[FourthTile].color == MyRed || MyLights[FourthTile].color == MyOrange || MyLights[FourthTile].color == MyYellow || MyLights[FourthTile].color == MyLime || MyLights[FourthTile].color == MyPink || MyLights[FourthTile].color == MyPurple)) { MyDestinations[MyMainNumber].GetComponentInChildren().text = "1"; MyDestinations[MyMainNumber].GetComponentInChildren().color = MyWhite; MyLights[MyMainNumber].color = MyWhite; } else { MyDestinations[MyMainNumber].GetComponentInChildren().text = string.Empty; MyDestinations[MyMainNumber].GetComponentInChildren().color = MyWhite; MyLights[MyMainNumber].color = MyWhite; } if ((MainNumber.color == MyBlue) && (MyLights[FirstTile].color == MyRed || MyLights[FirstTile].color == MyOrange || MyLights[FirstTile].color == MyYellow || MyLights[FirstTile].color == MyLime || MyLights[FirstTile].color == MyGreen || MyLights[SecondTile].color == MyRed || MyLights[SecondTile].color == MyOrange || MyLights[SecondTile].color == MyYellow || MyLights[SecondTile].color == MyLime || MyLights[SecondTile].color == MyGreen || MyLights[ThirdTile].color == MyRed || MyLights[ThirdTile].color == MyOrange || MyLights[ThirdTile].color == MyYellow || MyLights[ThirdTile].color == MyLime || MyLights[ThirdTile].color == MyGreen || MyLights[FourthTile].color == MyRed || MyLights[FourthTile].color == MyOrange || MyLights[FourthTile].color == MyYellow || MyLights[FourthTile].color == MyLime || MyLights[FourthTile].color == MyGreen)) { MyDestinations[MyMainNumber].GetComponentInChildren().text = "1"; MyDestinations[MyMainNumber].GetComponentInChildren().color = MyWhite; MyLights[MyMainNumber].color = MyWhite; } else { MyDestinations[MyMainNumber].GetComponentInChildren().text = string.Empty; MyDestinations[MyMainNumber].GetComponentInChildren().color = MyWhite; MyLights[MyMainNumber].color = MyWhite; } if ((MainNumber.color == MyPink) && (MyLights[FirstTile].color == MyRed || MyLights[FirstTile].color == MyOrange || MyLights[FirstTile].color == MyYellow || MyLights[FirstTile].color == MyLime || MyLights[FirstTile].color == MyLightBlue || MyLights[FirstTile].color == MyGreen || MyLights[SecondTile].color == MyRed || MyLights[SecondTile].color == MyOrange || MyLights[SecondTile].color == MyYellow || MyLights[SecondTile].color == MyLime || MyLights[SecondTile].color == MyLightBlue || MyLights[SecondTile].color == MyGreen || MyLights[ThirdTile].color == MyRed || MyLights[ThirdTile].color == MyOrange || MyLights[ThirdTile].color == MyYellow || MyLights[ThirdTile].color == MyLime || MyLights[ThirdTile].color == MyLightBlue || MyLights[ThirdTile].color == MyGreen || MyLights[FourthTile].color == MyRed || MyLights[FourthTile].color == MyOrange || MyLights[FourthTile].color == MyYellow || MyLights[FourthTile].color == MyLime || MyLights[FourthTile].color == MyLightBlue || MyLights[FourthTile].color == MyGreen)) { MyDestinations[MyMainNumber].GetComponentInChildren().text = "1"; MyDestinations[MyMainNumber].GetComponentInChildren().color = MyWhite; MyLights[MyMainNumber].color = MyWhite; } else { MyDestinations[MyMainNumber].GetComponentInChildren().text = string.Empty; MyDestinations[MyMainNumber].GetComponentInChildren().color = MyWhite; MyLights[MyMainNumber].color = MyWhite; } if ((MainNumber.color == MyPurple) && (MyLights[FirstTile].color == MyRed || MyLights[FirstTile].color == MyOrange || MyLights[FirstTile].color == MyYellow || MyLights[FirstTile].color == MyLime || MyLights[FirstTile].color == MyLightBlue || MyLights[FirstTile].color == MyGreen || MyLights[SecondTile].color == MyRed || MyLights[SecondTile].color == MyOrange || MyLights[SecondTile].color == MyYellow || MyLights[SecondTile].color == MyLime || MyLights[SecondTile].color == MyLightBlue || MyLights[SecondTile].color == MyGreen || MyLights[ThirdTile].color == MyRed || MyLights[ThirdTile].color == MyOrange || MyLights[ThirdTile].color == MyYellow || MyLights[ThirdTile].color == MyLime || MyLights[ThirdTile].color == MyLightBlue || MyLights[ThirdTile].color == MyGreen || MyLights[FourthTile].color == MyRed || MyLights[FourthTile].color == MyOrange || MyLights[FourthTile].color == MyYellow || MyLights[FourthTile].color == MyLime || MyLights[FourthTile].color == MyLightBlue || MyLights[FourthTile].color == MyGreen)) { MyDestinations[MyMainNumber].GetComponentInChildren().text = "1"; MyDestinations[MyMainNumber].GetComponentInChildren().color = MyWhite; MyLights[MyMainNumber].color = MyWhite; } else { MyDestinations[MyMainNumber].GetComponentInChildren().text = string.Empty; MyDestinations[MyMainNumber].GetComponentInChildren().color = MyWhite; MyLights[MyMainNumber].color = MyWhite; } } private bool ReturnGameStatusFinished() { int counter = 0; for (int i = 0; i < DesStatus[i]; i++) { if (DesStatus[i] == 1) { counter = counter + 1; } else { continue; } } if (counter == 49) { return true; } else { return false; } } public void ScoreCalculation() { int[] RowScores = new int[7]; int FinalScore; RowScores[0] = int.Parse(MyDestinations[0].GetComponentInChildren().text) * int.Parse(MyDestinations[1].GetComponentInChildren().text) * int.Parse(MyDestinations[2].GetComponentInChildren().text) * int.Parse(MyDestinations[3].GetComponentInChildren().text) * int.Parse(MyDestinations[4].GetComponentInChildren().text) * int.Parse(MyDestinations[5].GetComponentInChildren().text) * int.Parse(MyDestinations[6].GetComponentInChildren().text); RowScores[1] = int.Parse(MyDestinations[7].GetComponentInChildren().text) * int.Parse(MyDestinations[8].GetComponentInChildren().text) * int.Parse(MyDestinations[9].GetComponentInChildren().text) * int.Parse(MyDestinations[10].GetComponentInChildren().text) * int.Parse(MyDestinations[11].GetComponentInChildren().text) * int.Parse(MyDestinations[12].GetComponentInChildren().text) * int.Parse(MyDestinations[13].GetComponentInChildren().text); RowScores[2] = int.Parse(MyDestinations[14].GetComponentInChildren().text) * int.Parse(MyDestinations[15].GetComponentInChildren().text) * int.Parse(MyDestinations[16].GetComponentInChildren().text) * int.Parse(MyDestinations[17].GetComponentInChildren().text) * int.Parse(MyDestinations[18].GetComponentInChildren().text) * int.Parse(MyDestinations[19].GetComponentInChildren().text) * int.Parse(MyDestinations[20].GetComponentInChildren().text); RowScores[3] = int.Parse(MyDestinations[21].GetComponentInChildren().text) * int.Parse(MyDestinations[22].GetComponentInChildren().text) * int.Parse(MyDestinations[23].GetComponentInChildren().text) * int.Parse(MyDestinations[24].GetComponentInChildren().text) * int.Parse(MyDestinations[25].GetComponentInChildren().text) * int.Parse(MyDestinations[26].GetComponentInChildren().text) * int.Parse(MyDestinations[27].GetComponentInChildren().text); RowScores[4] = int.Parse(MyDestinations[28].GetComponentInChildren().text) * int.Parse(MyDestinations[29].GetComponentInChildren().text) * int.Parse(MyDestinations[30].GetComponentInChildren().text) * int.Parse(MyDestinations[31].GetComponentInChildren().text) * int.Parse(MyDestinations[32].GetComponentInChildren().text) * int.Parse(MyDestinations[33].GetComponentInChildren().text) * int.Parse(MyDestinations[34].GetComponentInChildren().text); RowScores[5] = int.Parse(MyDestinations[35].GetComponentInChildren().text) * int.Parse(MyDestinations[36].GetComponentInChildren().text) * int.Parse(MyDestinations[37].GetComponentInChildren().text) * int.Parse(MyDestinations[38].GetComponentInChildren().text) * int.Parse(MyDestinations[39].GetComponentInChildren().text) * int.Parse(MyDestinations[40].GetComponentInChildren().text) * int.Parse(MyDestinations[41].GetComponentInChildren().text); RowScores[6] = int.Parse(MyDestinations[42].GetComponentInChildren().text) * int.Parse(MyDestinations[43].GetComponentInChildren().text) * int.Parse(MyDestinations[44].GetComponentInChildren().text) * int.Parse(MyDestinations[45].GetComponentInChildren().text) * int.Parse(MyDestinations[46].GetComponentInChildren().text) * int.Parse(MyDestinations[47].GetComponentInChildren().text) * int.Parse(MyDestinations[48].GetComponentInChildren().text); FinalScore = RowScores[0] + RowScores[1] + RowScores[2] + RowScores[3] + RowScores[4] + RowScores[5] + RowScores[6]; UserScore.text = FinalScore.ToString(); } }