So i’m working on a board game, like axis and allies or total war, and at the beginning of the game, the players choose their country, the option to choose that country is then removed, leaving text saying the country had been chosen, forcing the rest of the players to choose a different country. All of this works fine until i test it over the network. One of the players will choose britain, the option then becomes grayed out on that computer, however, the option remains on all other instances of the game. How can i update some GUI classes, but not others, like, i only want to update/change for all players the options for choosing a country, not things like the create game button.
function OnGUI()
{
if(britainChosen)
{
GUI.Label(Rect(510, 80, 280, 30), "Britain Chosen");
}
if(showLobby)
{
GUI.Box(Rect(500, 25, 300, 25), lobbyName);
GUI.Box(Rect(500, 55, 300, 300), "Country");
if(britainChosen == false)
{
if(GUI.Button(Rect(510, 80, 280, 30), "Britain"))
{
britainChosen = true;
Debug.Log("Chose Britain");
//setup britain
}
}
if(germanyChosen == false)
{
if(GUI.Button(Rect(510, 120, 280, 30), "Germany") && germanyChosen == false)
{
germanyChosen = true;
Debug.Log("Chose Germany");
//setup germany
}
}
}
if(!Network.isClient && !Network.isServer)
{
if(GUI.Button(Rect(btnX, btnY, btnW, btnH), "Create Game"))
{
startServer();
}
if(hostData)
{
for(var i : int = 0; i<hostData.length; i++)
{
if(GUI.Button(Rect(btnX * 1.5 + btnW, btnY * 1.2 + (btnH * i), btnW * 3, btnH * 0.5), hostData*.gameName))*
-
{*
_ Network.Connect(hostData*);_
_ }_
_ }_
_ }_
_ }_
_}*_