Duplicate rows in Terminal Hacker - Why?

using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Hacker : MonoBehaviour
{
    //Game State
    int level;
    
    
    // Use this for initialization

    void Start()
    {
        var greeting = "Hello Sakari";
        ShowMainMenu(greeting);
    }

    void ShowMainMenu(string greeting)
    {
        Terminal.ClearScreen();

        Terminal.WriteLine(greeting);
        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("Press 3 for NASA");
        Terminal.WriteLine("Write menu to return");
        Terminal.WriteLine("Enter your selection:");
    }

    void OnUserInput(string input)
    {
        if (input == "menu")
        {
            ShowMainMenu("Hello, thanks to returning main menu");
        }
        else if (input == "1")
        {
            level = 1;
            StartGame();
        }
        else if (input == "2")
        {
            level = 2;
            StartGame();
        }
        else if (input == "007")
        {
            Terminal.WriteLine("Please select a level  mr James Bond");
        }
        else
        {
            Terminal.WriteLine("Please choose a valid level");
        }

    }

    void StartGame()
    {
        Terminal.WriteLine("You have chosen level " + level);
    }
}

1 Like

Solved this by myself. I had two hacker script running at the same time. And that might be because yesterday I selected in Vicual Studio “Attact to Unity” buttone without knowing what it is doing. Now I think it created copy of my hacker script to my Assets - Am I right , please confirm. I removed second hacker in debug window and voi la, I can not see duplicate rows anymore.

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms