I have been unity for a little bit now…started with Java but decided for some reason to try my hand at C#…even though I was not very good at Java either (Heh).
I keep getting Assets/Scripts/MainMenuManager.cs(21,25): error CS0103: The name `Menu_Main’ does not exist in the current context. It is late here so I may be missing something simple or I may have butchered the code completely and any help would be welcome.
using UnityEngine;
using System.Collections;
public class MainMenuManager : MonoBehaviour
{
public string CurrentMenu;
public string Introduction;
public string NewCharacter;
public string LoadCharacter;
public string Settings;
void start()
{
CurrentMenu = "Main";
}
void OnGUI ()
{
if (CurrentMenu == "Main")
Menu_Main();
if (CurrentMenu == "Introduction")
Menu_Intro();
if (CurrentMenu == "New Character")
Menu_NewChar();
if (CurrentMenu == "Load Character")
Menu_LoadChar();
if (CurrentMenu == "Settings")
Menu_Settings();
}
public void NavigateTo(string nextmenu)
{
CurrentMenu = nextmenu;
}
private void Menu_Intro()
{
GUI.BeginGroup (new Rect (Screen.width / 2 - 50, Screen.height / 2 - 50, 160, 300));
if (GUI.Button (new Rect (0,40,150,50), "Introduction"))
{
NavigateTo("Introduction");
}
}
private void Menu_NewChar()
{
GUI.Button (new Rect (0,80,150,50), "New Character");
{
NavigateTo("New Character");
}
}
private void Menu_LoadChar()
{
GUI.Button (new Rect (0,120,150,50), "Load Character");
{
NavigateTo("Load Character");
}
}
private void Menu_Settings()
{
// Need a settings script, until then this menu is useless.
GUI.Button (new Rect (0,160,150,50), "Settings");
{
NavigateTo("Settings");
}
GUI.EndGroup ();
}
}
I am trying to get it so that when I click on a button it brings up a new GUI segment that allows the user to get to other…segments.
Not sure if this is the right way to post coding for questions either so I apologize if I messed that up as well.
i am just one hot mess tonight…er morning?