I dunno how, but unity gives me Non-Existing errors! HELP!!!
Following are the errors:
- Unexpected token: }.
- expecting (, found 'HealthConfidenceNRG'
- ';' expected. Insert a semicolon at the end.
- expecting (, found 'AnimationController'.
- ';' expected. Insert a semicolon at the end.
- expecting }, found ''.
Code:
function OnTriggerEnter( other : Collider ) { if (other.tag == AreaChanger ) { if (score == ReqiredScore) { Time.timeScale = 0; AskToChangeScene = true; } else { Time.timeScale = 0; NotEnoughScore = true; } } } function OnGUI() { GUI.skin = newSkin; GUI.Button (new Rect (0,1,100,30), "Energy" + ":" + Energy.ToString()); GUI.Button (new Rect (100,1,100,30), "Health" + ":" + Health.ToString()); GUI.Button (new Rect (200,1,100,30), "Confidence" + ":" + Confidence.ToString()); if (LostTheGame) { GUI.Box(Rect(Screen.width /2 - 100,Screen.height /2 - 100,250,200), "You Lose"); if(GUI.Button(Rect(Screen.width /2 - 100,Screen.height /2 - 50,250,50), "Main Menu")){ Application.LoadLevel(MenuSceneName); } if(GUI.Button(Rect(Screen.width /2 - 100,Screen.height /2 ,250,50), "Retry")){Application.LoadLevel(CurrentSceneName);} } if (AskToChangeScene) { GUI.Box(Rect(Screen.width /2 - 100,Screen.height /2 - 100,250,200), "Enter Building?"); if(GUI.Button(Rect(Screen.width /2 - 100,Screen.height /2 - 50,250,50), "Yes")){ Application.LoadLevel(OtherSceneName); } if(GUI.Button(Rect(Screen.width /2 - 100,Screen.height /2 ,250,50), "No")) } { Time.timeScale = 1; AskToChangeScene = false; } if (NotEnoughScore) { GUI.Box(Rect(Screen.width /2 - 100,Screen.height /2 - 100,250,200), "You Did Not Find Enough Feathers"); if(GUI.Button(Rect(Screen.width /2 - 100,Screen.height /2 ,250,50), "Okay.")) {Time.timeScale = 1; NotEnoughScore = false;} } } function HealthConfidenceNRG(){ Energy -= EnergyLoss; if (Energy <= 1) { Time.timeScale = 0; Debug.Log("You Lost The Game!!!"); LostTheGame = true;} if(Health <= 1) { Time.timeScale = 0; Debug.Log("You Lost The Game!!!"); LostTheGame = true;} if(Confidence <= 1) { Time.timeScale = 0; Debug.Log("You Lost The Game!!!"); LostTheGame = true;} } function AnimationController() { if (Input.GetKey(KeyCode.LeftArrow)||Input.GetKey(KeyCode.RightArrow )) {MyAnimatedModel.animation.Play(RunAnimation.name);} if (rigidbody.IsSleeping()) {MyAnimatedModel.animation.Play(PlatformAnimation.name);} }