i don’t know what it mean’s
using UnityEngine;
using System.Collections;
using UnityEngine.UI;
public class TextController : MonoBehaviour {
public Text text;
private enum States {cell, 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.sheets_1) {state_sheets_1 ();}
else if (myState == States.lock_0) {state_lock_0(); }
else if (myState == States.lock_1) {state_lock_1 ();}
else if (myState == States.mirror) {state_mirror();}
else if (myState == States.cell_mirror) {state_cell_mirror();}
else if (myState == States.freedom) {state_freedom();}
}
/// <summary>
/// State_cell this instance.
/// </summary>
void state_cell () {
text.text = "you are in a prison you know how to escape the prison, but there is one problem, you forgot that you still have to get out of " +
"the cell, well you look around there are some dirty sheets behind you on the bed, to your left is the sink with a mirror, " +
"and in front of you is the door that is locked from the out side.\n\n " +
"Press S to look at the sheets Press M to look at the mirror and Press L to look at the lock ";
if (Input.GetKeyDown(KeyCode.S)) { myState = States.sheets_0;
}
}
/// <summary>
/// State_cell this instance.
/// </summary>
void state_mirror () {
text.text = "the mirror is lose it might come in handy\n\n " +
"Press T to take the mirror and R to return ";
if (Input.GetKeyDown(KeyCode.T)) {myState = States.cell_mirror;}
else if (Input.GetKeyDown(KeyCode.R)) {myState = States.cell;}
}
/// <summary>
/// State_lock_1 this instance.
/// </summary>
void state_cell_mirror () {
text.text = "come on think there are some sheets and the door you must be abel to do something \n\n " +
"Press S to look at the sheets and L to look at the lock on the door";
if (Input.GetKeyDown(KeyCode.S)) {myState = States.sheets_1;}
else if (Input.GetKeyDown(KeyCode.L)) {myState = States.lock_1;}
}
///
/// State_sheets_0 this instance.
///
void state_sheets_0 () {
text.text = "wow how meny people have slept in these rags, well we won’t be in here much longer better get " +
"back to looking for a way to get out of here \n\n " +
"Press R to return ";
if (Input.GetKeyDown(KeyCode.R)) {myState = States.cell;
}
}
/// <summary>
/// State_sheets_1 this instance.
/// </summary>
void state_sheets_1 () {
text.text ="looking at the sheets with the mirror won't make them clean \n\n " +
"Press R to return ";
if (Input.GetKeyDown(KeyCode.R)) { myState = States.cell_mirror;
}
}
/// <summary>
/// /
/// </summary>
void state_lock_0 () {
text.text = "hmm it's one of those number key code locks there is unlimtid combinations only if i could see the dirty finger prints\n\n " +
"Press R to return ";
if (Input.GetKeyDown(KeyCode.R)) { myState = States.cell;
}
}
/// <summary>
/// State_lock_1 this instance.
/// </summary>
void state_lock_1 () {
text.text = "you put the mirror through the bars yes yu can see the finger prints and you press the numers 12345 really thats the " +
"combination, you here a click\n\n " +
"Press O to open the door";
if (Input.GetKeyDown(KeyCode.O)) {myState = States.freedom;}
else if (Input.GetKeyDown(KeyCode.R)) {myState = States.cell_mirror;}
}
/// <summary>
/// /
/// </summary>
void state_freedom () {
text.text = "yes you are free, uh oh you took to long to break out of your cell the gaurd see's you and you get sen't back in \n\n " +
"Press P to try agin";
if (Input.GetKeyDown(KeyCode.P)) { myState = States.cell;
}
}
Looks like you have a closing } missing from the end of the file.
thank you so much
1 Like
You’re very welcome.