- Home /
Error CS1519
I wrote the game and came across this error:
Assets/Scripts/MenuManager.cs(10,12): error CS1519: Unexpected symbol `void' in class, struct, or interface member declaration
Here is the code of this file:
using UnityEngine;
using System.Collections;
public class MenuManager : MonoBehaviour
{
public string CurrentMenu;
public string MatchName
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()
{
if(GUI.Button(new Rect(10,10,200,50), "HostGame"))
{
NavigateTo("host");
}
}
private void Menu_HostGame()
{
//Buttons Host Game
if(GUI.Button(new Rect(10,10,200,50), "Back"))
{
NavigateTo("Main");
}
if(GUI.Button(new Rect(10,60,200,50), "Start Server"))
{
}
GUI.Label(new Rect(220,10,130,30), "Match Name");
MatchName = GUI.TextField(new Rect(400,10,200,30), MatchName);
}
private void Menu_Lobby()
{
}
}
Comment
Your answer
Follow this Question
Related Questions
Font sizes, GUI, Iphones and even more head scracthing problems 0 Answers
Distribute terrain in zones 3 Answers
show guitexture on button click 1 Answer
Umlaute missing in Unity GUI. 1 Answer
Multiple Cars not working 1 Answer