Error:
Assets/Scripts/GUI/MainMenu.cs(75,55): error CS0103: The name `OptionsMenu’ does not exist in the current context
using UnityEngine;
using System.Collections;
public class MainMenu : MonoBehaviour
{
public Ray ray;
public RaycastHit Hit;
public GameObject MainM;
public GameObject OptionsM;
public enum Menus
{
MainMenu,
OptionsMenu
}
public Menus CurrentMenu;
void Start()
{
CurrentMenu = Menus.MainMenu;
}
void Update()
{
if(CurrentMenu == Menus.MainMenu)
{
OptionsM.SetActive(false);
MainM.SetActive(true);
}
else if(CurrentMenu == Menus.OptionsMenu)
{
OptionsM.SetActive(true);
MainM.SetActive(false);
}
TapSelect();
}
private void TapSelect()
{
foreach(Touch touch in Input.touches)
{
if(touch.phase == TouchPhase.Began)
{
ray = Camera.main.ScreenPointToRay(touch.position);
if(Physics.Raycast(ray, out Hit))
{
if(Hit.transform.tag == "PlayButton")
{
//Debug.Log("Hit Play Button");
Application.LoadLevel(1);
}
}
}
}
ray = Camera.main.ScreenPointToRay(Input.mousePosition);
if(Physics.Raycast(ray, out Hit))
{
if(Input.GetMouseButton(0))
{
if(Hit.transform.tag == "PlayButton")
{
//Debug.Log("Hit Play Button");
Application.LoadLevel(1);
}
else if(Hit.transform.tag == "OptionsButton")
{
//Debug.Log("Hit Options Button");
CurrentMenu = OptionsMenu;
}
}
}
}
}