Over the last few days unity has suddenly given me errors when i now save my scripts can you tell me why, when they were fine before?
Here is an example:
Errors:
Assets/My Scripts/Component Click.js(35,1): BCE0043: Unexpected token: if.
Assets/My Scripts/Component Click.js(35,12): UCE0001: ‘;’ expected. Insert a semicolon at the end.
Assets/My Scripts/Component Click.js(37,33): BCE0044: expecting :, found ‘;’
var isMotherboard = false;
var isCpu = false;
var isPsu = false;
var isGpu = false;
function OnMouseEnter()
{
renderer.material.color = Color.white;
}
function OnMouseExit()
{
renderer.material.color = Color.white;
}
function OnMouseUp()
{
if( isMotherboard )
{
Application.Loadlevel(2);
}
}
{
if( isCpu )
{
Application.Loadlevel(3);
}
}
{
if( isPsu )
{
Application.Loadlevel(4);
}
}
{
if( isGpu )
{
Application.LoadLevel(5);
}
}