i need help i get this error cs0103 The Name CurMenu does not exist ,i’m working on the GUI
my script :
using UnityEngine;
using System.Collections;
public class Menu : MonoBehaviour {
private string CutMenu;
public string Name;
// Use this for initialization
void Start () {
CutMenu = "Main";
name = PlayerPrefs.GetString ("PlayerName");
}
// Update is called once per frame
void Update () {
}
void ToMenu (string menu){
CurMenu = menu;
}
void onGUI(){
if(CurMenu == "Main")
Main();
if(CurMenu == "Host")
Host();
}
private void Main(){
if(GUI.Button(new Rect(0,0,128,32),"Host a match")){
ToMenu("Host");
}
Name = GUI.TextField(new Rect(130,0,182,32),Name);
if (GUI.Button (new Rect (260, 0, 128, 32), "Save")) {
PlayerPrefs.SetString ("PlayerName", Name);
}
}
private void Host(){
if(GUI.Button(new Rect(0,0,128,32),"Back")){
ToMenu("Main");
}
}
}
Any HELP?