- Home /
Parsing error in C#
i keep geting this Assets/Standard Assets/MenuObject.cs.cs(4,1): error CS8025: Parsing error
this my code 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) ; } } }
Dupe'd here.
there is button that you use to mark text as preformatted it is the one with 1's and 0's all over it.
It looks however that you have semi colons all over the place.
using UnityEngine;
using System.Collections ;
public class $$anonymous$$enuObject: $$anonymous$$onoBehaviour
{
public bool isQuit = false ;
void On$$anonymous$$ouseEnter()
{
Renderer.material.color = Color.red ;
}
void On$$anonymous$$ouseExit()
{
Renderer.material.color = Color.white ;
}
void On$$anonymous$$ouseDown()
{
if(isQuit)
{
Application.Quit() ;
}
else
{
Application.LoadLevel(1) ;
}
}
}
If you're going to post the same code in another question, then you should accept an answer for the other question you asked.
Answer by Ricardo Arango · Jun 14, 2011 at 05:04 PM
Please try understanding your problem before posting for help. There are many tutorials to learn Unity scripting:
http://answers.unity3d.com/questions/12321/how-can-i-start-learning-unity-fast-list-of-tutori.html
Answer by DaveA · Jun 14, 2011 at 06:11 PM
Is that right, that your file is called MenuObject.cs.cs ? If so, change it to just MenuObject.cs
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
I can't figure why I'm getting a parsing error with my C# Code. 1 Answer
Parsing error. No idea what it is or what the problem is. 2 Answers
Deserialize nested Json data 1 Answer