public void FindMatch() { lobbyMan.canInput = false; findMatchButton.gameObject.SetActive(false); addPlayerButton.gameObject.SetActive(true); // Turn off all the references to this findmatch button _2DContextButton findButton = findMatchButton.GetComponent <_2DContextButton>(); if (findButton.northNeighbor) { findButton.northNeighbor.GetComponent <_2DContextButton>().southNeighbor = null; } if (findButton.southNeighbor) { findButton.southNeighbor.GetComponent <_2DContextButton>().northNeighbor = null; } if (findButton.westNeighbor) { findButton.westNeighbor.GetComponent <_2DContextButton>().eastNeighbor = null; } if (findButton.eastNeighbor) { findButton.eastNeighbor.GetComponent <_2DContextButton>().westNeighbor = null; } singleton.matchMaker.ListMatches(0, 10, "", true, 0, 0, OnInternetMatchList); }
void SetUpButton(_2DContextButton button) { activeButton = button.gameObject; if (multiplePlayers && otherPlayer) { if (playerOnRight) { button.eastNeighbor = otherPlayer.activeButton; if (button.eastNeighbor) { button.eastNeighbor.GetComponent <_2DContextButton>().westNeighbor = button.gameObject; } } else { button.westNeighbor = otherPlayer.activeButton; if (button.westNeighbor) { button.westNeighbor.GetComponent <_2DContextButton>().eastNeighbor = button.gameObject; } } } button.northNeighbor = lobbyMan.addPlayerButton; if (button.northNeighbor) { button.northNeighbor.GetComponent <_2DContextButton>().southNeighbor = button.gameObject; } button.southNeighbor = lobbyMan.returnToMenuButton; if (button.southNeighbor) { button.southNeighbor.GetComponent <_2DContextButton>().northNeighbor = button.gameObject; } // Select this button lobbyMan.SelectElement(button.gameObject); }