I've been trying, without success, to get NGUI components to update across the network in a multiplayer game.
For my testing, I've been using a UICheckbox and trying to get the checkbox.isChecked status to update for two players connected via networking.
I have tried placing NetworkView components and setting the Observed to UICheckbox, UIButton, and to the checkmark's UIsprite script. I've also tried placing my OnClick() code in an RPC method and calling that method from the OnClick().
void OnClick()
{
networkView.RPC("PlayerSelected", RPCMode.All);
}
[RPC]
void PlayerSelected()
{
if (checkbox.isChecked)
{
checkbox.isChecked = true;
gameSetupScript.playerHost = playerClass;
}
else
{
checkbox.isChecked = false;
gameSetupScript.playerHost = PlayerClass.None;
}
}
Any help anyone can offer is appreciated.