I’m having a parsing error that keeps coming up on the last line. I can’t seem to find what I’m missing. I’ve removed all the code after void update but I still get the error. What am I doing wrong?
using UnityEngine;
using UnityEngine.UI;
using System.Collections;
public class TextController : MonoBehaviour {
public Text text;
private enum States {cell, cell_1, mirror, sheets_0, lock_0, cell_mirror, sheets_1, lock_1, freedom};
private States myState;
// Use this for initialization
void Start () {
myState = States.cell;
}
// Update is called once per frame
void Update () {
print (myState);
if (myState == States.cell) {state_cell ();}
else if (myState == States.sheets_0) {state_sheets_0();}
else if (myState == States.cell_1) {state_cell_1();}
else if (myState == States.mirror) {state_mirror();}
else if (myState == States.lock_0) {state_lock_0();}
else if (myState == States.cell_mirror) {state_cell_mirror();}
else if (myState == States.sheets_1) {state_sheets_1();}
else if (myState == States.lock_1) {state_lock_1();}
else if (myState == States.freedom) {state_freedom();}
}
void state_cell () {
text.text = "Some days, it's not worth getting out of bed and today is certainly one." +
"You were on your way to the store to get the latest console game when " +
"suddenly, you were apprehended by the police for 'trespassing on " +
"forbidden grounds'. Maybe that shortcut through the mayor's bedroom " +
"wasn't the best idea. So now, here you are, stuck in some unknown " +
"facility waiting on who knows what. It's been two hours and no one " +
"has come. Time to escape.\n\n" +
"Looking around, you see a cot with dirty sheets (C), a mirror (M), " +
"and a door locked from the outside (D).\n\n" +
"What do you want to look at?";
if (Input.GetKeyDown(KeyCode.C)) {myState = States.sheets_0;}
else if (Input.GetKeyDown(KeyCode.M)) {myState = States.mirror;}
else if (Input.GetKeyDown(KeyCode.D)) {myState = States.lock_0;}
}
void state_sheets_0 () {
text.text = "This is your cot but I wouldn't recommend sleeping on it. That color of " +
"yellow doesn't get there by people just sleeping on it. The less you " +
"think about it the, the better.\n\n" +
"Press (R) to return.";
if (Input.GetKeyDown(KeyCode.R)) {myState = States.cell_1;}
}
void state_cell_1 () {
text.text = "Home, sweet home. At least until you break out of here.\n\n" +
"You see a cot with dirty sheets (C), a mirror (M), " +
"and a door locked from the outside (D).\n\n" +
"What do you want to look at?";
if (Input.GetKeyDown(KeyCode.C)) {myState = States.sheets_0;}
else if (Input.GetKeyDown(KeyCode.M)) {myState = States.mirror;}
else if (Input.GetKeyDown(KeyCode.D)) {myState = States.lock_0;}
}