- Home /
Question by
salad__fingers · Feb 11, 2013 at 08:59 PM ·
c#unexpectedsymbol
CS1525: 60,68 Unexpected symbol MatchMaxPlayers
Thanks for help. using UnityEngine; using System.Collections;
public class MenuManager : MonoBehaviour
{
public string CurrentMenu;
public int MatchName = "";
public int MatchPassword = "";
public int MatchMaxPlayers = 32;
void Start()
{
CurrentMenu = "main";
}
void OnGUI()
{
if(CurrentMenu == "main")
Menu_Main();
if(CurrentMenu == "Lobby")
Menu_Lobby();
if(CurrentMenu == "Host")
Menu_HostGame();
}
public void NavigateTo(string nextmenu)
{
CurrentMenu = nextmenu;
}
private void Menu_Main()
{
//Main Menu Buttons
if (GUI.Button(new Rect(10, 10, 200, 50), "Host Game"))
{
NavigateTo("Host");
}
}
private void Menu_HostGame()
{
//Buttons for Hosting
if (GUI.Button(new Rect(10, 10, 200, 50), "Back"))
{
NavigateTo("main");
}
if (GUI.Button(new Rect(10, 60, 200, 50), "Start Match"))
{
}
GUI.Label(new Rect(220, 10, 130, 30), "Match Name");
MatchName = GUI.TextField(new Rect(400, 10, 200, 30), MatchName);
GUI.Label(new Rect(220, 50, 130, 30), "Match Password");
MatchPassword = GUI.PasswordField(new Rect(400, 50, 200, 30), MatchPassword, "*");
GUI.Label(new Rect(220, 90, 130, 30), "Match Max Players");
GUI.Label(new Rect(400, 90, 200, 30) MatchMaxPlayers.ToString());
MatchMaxPlayers = Mathf.Clamp(MatchMaxPlayers, 8, 32);
if (GUI.Button(new Rect(425, 90, 25, 30), "+"))
MatchMaxPlayers += 2;
if (GUI.Button(new Rect(450, 90, 25, 30), "-"))
MatchMaxPlayers -= 2;
}
private void Menu_Lobby()
{
}
}
Comment
Best Answer
Answer by Dave-Carlile · Feb 11, 2013 at 09:02 PM
Line 57...
GUI.Label(new Rect(400, 90, 200, 30) MatchMaxPlayers.ToString());
You're missing a comma before MatchMaxPlayers
.
Yeah I noticed that right after I posted. Thanks though.
You can still accept my answer since I made the effort to answer your question.
I don't know how to do that, but I want to. I try to thumbs up your question but I don't have permission.
Hmmm - there should be a small circle or checkmark under the thumbs down icon. Just click on it.
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
Unexpected Symbol '_toon = new PlayerChar' 1 Answer
Unexpected symbol 'void' C# 1 Answer
How do I load the Main Menu when all eneimes are dead? (c#) 0 Answers