- Home /
Question by
OwenKuhn · May 19, 2014 at 10:41 PM ·
networkingjava
How do I get menus to show up on a client?
Basically I have a character selection screen on the host. I want the client to see the exact same thing, even as things change (such as a character being selected). However, it doesn't seem to like the idea of instantiating my GUI buttons, so I was wondering what the best way of doing it is. Here's an example of my script right now.
function OnGUI ()
{
if (GUI.Button (Rect (10,10,140,25), name1))
{
print ("Select Player 1");
selector = 1;
}
if (GUI.Button (Rect (160,10,140,25), name2))
{
print ("Select Player 2");
selector = 2;
}
if (manager.maxClients >= 2)
if (GUI.Button (Rect (310,10,140,25), name3))
{
print ("Select Player 3");
selector = 3;
}
if (manager.maxClients >= 3)
if (GUI.Button (Rect (460,10,140,25), name4))
{
print ("Select Player 4");
selector = 4;
}
if (GUI.Button (Rect (610,10,140,25), "Next"))
{
Application.LoadLevel ("StageSelect");
}
Comment
Your answer
Follow this Question
Related Questions
Data keeps "hanging". TCP client/server 2 Answers
Use KryoNet in C# via IKVM 0 Answers
Unity networking tutorial? 6 Answers
Unity client <--> Java Server 1 Answer
Help with Java socket server 1 Answer