I have made a script, and it only has one error, and that is this:
Assets/Scripts/NewMenuScript.cs(4,9): error CS8025: Parsing error
here is the script:
using UnityEngine;
using System.Collections;
GUISkin = myskin ;
int hSliderValue = 0.5 ;
public class NewMenuScript : MonoBehaviour {
GUI.Skin myskin;
// define and create our GUI delegate
private delegate void GUIMethod();
private GUIMethod currentGUIMethod;
void Start ()
{
// start with the main menu GUI
this.currentGUIMethod = MainMenu;
}
public void MainMenu()
{
GUI.Box (new Rect (Screen.width /2 -90,160,180,265), "Main Menu");
if (GUI.Button (new Rect (Screen.width /2-75,195, 150, 30), "Play Game"))
{
Application.LoadLevel(5);
}
if (GUI.Button (new Rect (Screen.width /2 -75,230, 150, 30), "Tutorial Level"))
{
Application.LoadLevel(3);
}
if (GUI.Button (new Rect (Screen.width /2 -75,300, 150, 30), "Credits"))
{
Application.LoadLevel(2);
}
if (GUI.Button (new Rect (Screen.width /2 -75,335, 150, 30), "Quit Game"))
{
Application.Quit();
}
if (GUI.Button (new Rect (Screen.width /2 -75,265,150,30), "Options"))
{
// options button clicked, switch to new menu
this.currentGUIMethod = OptionsMenu;
}
}
private void OptionsMenu()
{
GUI.skin = myskin;
GUI.Label (new Rect ( Screen.width /3 - 17, 180, 50, 35), "Sound");
hSliderValue = GUI.HorizontalSlider (new Rect (Screen.width /2 -50,195, 100, 30), hSliderValue, 0.0, 1.0);
if (GUI.changed)
{
if (hSliderValue == 0)
{
AudioListener.volume = 0;
}
else
{
AudioListener.volume = 1;
}
}
if (GUI.Button (new Rect (Screen.width /2 -75, 265, 150, 30), "Back"))
{
this.currentGUIMethod = MainMenu;
}
}
// Update is called once per frame
public void OnGUI ()
{
this.currentGUIMethod();
}
}
I hope someone can help me solve this.