Advertisement
Guest User

Untitled

a guest
Nov 12th, 2019
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.52 KB | None | 0 0
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using UnityEngine;
  5.  
  6. public class Hacker : MonoBehaviour
  7.  
  8. //GameState
  9. int level;
  10. enum Screen { MainMenu, Password, Win };
  11. Screen currentScreen;
  12. string password;
  13.  
  14. // Start is called before the first frame update
  15. void Start()
  16.  
  17.  
  18.  
  19. void ShowMainMenu()
  20. {
  21. currentScreen = Screen.MainMenu;
  22. Terminal.ClearScreen();
  23. Terminal.WriteLine("What would you like to hack?");
  24. Terminal.WriteLine("Press 1 for Neighbour's Wifi");
  25. Terminal.WriteLine("Press 2 for Local Police Station");
  26. Terminal.WriteLine("Press 3 for Pentagon");
  27. Terminal.WriteLine("Enter your selection");
  28.  
  29.  
  30.  
  31.  
  32. void OnUserInput(string input)
  33. {
  34. RunMainMenu(input)
  35. }
  36. else if (currentScreen == Screen.Password)
  37. {
  38. CheckPassword(Input);
  39. }
  40. }
  41.  
  42. void RunMainMenu(string input)
  43. {
  44.  
  45. if (input == "1")
  46. {
  47. level = 1;
  48. password = "test1";
  49. StartGame();
  50. }
  51. else if (input == "2")
  52. {
  53. level =2;
  54. password = "test2"
  55. StartGame();
  56. }
  57. else if (input == "egg")
  58.  
  59. void StartGame()
  60.  
  61. Terminal.WriteLine("You have chosen level " + level);
  62. Terminal.WriteLine("Please enter your password: ");
  63. }
  64.  
  65. void CheckPassword(string input)
  66. {
  67. if (input == password)
  68. {
  69. Terminal.WriteLine("Nice one!");
  70. }
  71. else
  72. }
  73. Terminal.WriteLine("Sorry, Wrong Password ;(");
  74. }
  75. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement