hello i am trying to make my game read passwords the passwords are there in the debugger but when i type it in it just duplicates and says the error above any tips or trick that can help me? here is my code
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Security.Cryptography;
using UnityEngine;
[DebuggerDisplay("{" + nameof(GetDebuggerDisplay) + “(),nq}”)]
public class Hacker : MonoBehaviour {
// Game state
int level;
enum Screen { MainMenu, Password, Win };
Screen currentScreen;
string password;
// Use this for initialization
void Start()
{
ShowMainMenu();
}
void ShowMainMenu()
{
currentScreen = Screen.MainMenu;
Terminal.ClearScreen();
Terminal.WriteLine("What would you like to hack into?");
Terminal.WriteLine("Press 1 for the local library");
Terminal.WriteLine("Press 2 for the police station");
Terminal.WriteLine("Enter your selection:");
}
void OnUserInput(string input)
{
if (input == "menu")
{
ShowMainMenu();
}
else if (currentScreen == Screen.MainMenu)
{
Runmainmenu(input);
}
else if (currentScreen == Screen.Password)
{
Checkpassword(input);
}
}
private void Checkpassword(string input)
{
throw new NotImplementedException();
}
void CheckPassword(string input)
{
if (input == password)
{
checkpassword(input);
Terminal.WriteLine("Sorry, wrong password!");
}
else
{
Terminal.WriteLine("WELL DONE!");
}
}
private void checkpassword(string input)
{
Checkpassword(input);
}
private void Runmainmenu(string input)
{
{
if (input == "1")
{
level = 1;
password = "book";
StartGame();
}
if (input == "2")
{
level = 2;
password = "handcuffs";
StartGame();
}
else if (input == "007")
{
Terminal.WriteLine("Please select a level Mr Bond!");
}
else
{
}
}
}
void StartGame()
{
currentScreen = Screen.Password;
Terminal.WriteLine("You have chosen level " + level);
Terminal.WriteLine("Please enter your password: ");
}
string GetDebuggerDisplay()
{
return ToString();
}
}