- Home /
whats wrong with this code for a menu
using UnityEngine;
using System.Collections;
public class MenuObject : MonoBehaviour
{
public bool isQuit = false;
void OnMouseEnter()
{
renderer.material.color = Color.red;
}
void OnMouseExit()
{
renderer.material.color = Color.white;
}
void OnMouseDown()
{
if(isQuit)
{
Application.Quit()
}
else
{
Application.Loadlevel(1) :
}
}
}
i keep geting a parsing error and a unexpected symbol '}'
O$$anonymous$$ we have solved the unexpected symbol but i keep geting this Assets/Standard Assets/$$anonymous$$enuObject.cs.cs(4,1): error CS8025: Parsing erro
Answer by willgoldstone · Jun 14, 2011 at 03:52 PM
You have a : instead of a ; after your Loadlevel command - which should also be LoadLevel.
Answer by almo · Jun 14, 2011 at 03:58 PM
You need a ';' after LoadLevel and a ';' after Application.Quit(). These were easier to spot after I reformatted the code for you.
Answer by onevcat · Jun 14, 2011 at 04:37 PM
A tip: double click the error message, and you will be the line whick contains the error.
Your answer
Follow this Question
Related Questions
Unable To Find Solution For Errors 1 Answer
5 Errors, Need help, Unexpected symbol private etc 0 Answers
If CODE problems.. 1 Answer
Errors CS1525 and CS8025.... 1 Answer
I can't see the problem. 1 Answer