Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- using UnityEngine.UI;
- using System.Collections;
- public class TextController : MonoBehaviour {
- public Text text;
- private enum States {Earth, ship, Kepler, Epic, TauCete, Mars}
- private States myState;
- // Use this for initialization
- void Start () {
- myState = States.Earth;
- text.text = "The human race is no more, with the exception of a few scientists.";
- }
- // Update is called once per frame
- void Update () {
- print (myState);
- if (myState == States.Earth) {state_Earth();}
- else if (myState == States.ship) {state_ship();}
- else if (myState == States.Kepler) {state_Kepler();}
- else if (myState == States.Epic) {state_Epic();}
- else if (myState == States.TauCete) {state_TauCete();}
- else if (myState == States.Mars) {state_Mars();}
- }
- void state_Earth() {
- text.text = "You have been provided with sufficently " +
- "diverse specimens of DNA, and all of the " +
- "data needed, to find a suitable planet " +
- "and clone the beginning of the new human " +
- "race to populate it.\n\n " +
- "Press S to board escape ship or T to go into " +
- "terminator mode on the remaining humans and " +
- "repopulate the world with androids " ;
- if (Input.GetKeyDown(KeyCode.S)) {
- myState = States.ship;
- }
- }
- void state_ship() {
- text.text = "For which planet do you wish to set course? \n " +
- "Press K for Kepler planets, E for Epic, T for " +
- "Tau Cete, or M for Mars " ;
- if (Input.GetKeyDown(KeyCode.K)) {
- myState = States.Kepler;
- }
- if (Input.GetKeyDown(KeyCode.E)) {
- myState = States.Epic;
- }
- if (Input.GetKeyDown(KeyCode.T)) {
- myState = States.TauCete;
- }
- if (Input.GetKeyDown(KeyCode.M)) {
- myState = States.Mars;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement