private void checkText() { //Debug.Log(ms.getStatus()); for (int i = 1; i <= 3; i++) { //Debug.Log(ms.isAvailable(i)); if (ms.isAvailable(i)) { int temp = (i != 2 && i == 3) ? 1 : 3; if (i == 2) { temp = 2; } UnityEngine.UI.Text changes = txts[temp].GetComponent <UnityEngine.UI.Text>(); changes.text = "Map " + i; } } }