//
    // Update the input every frame
    // This gets new key input and calls the OnInputText callback
    //
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.Tab) || Input.GetKeyDown(KeyCode.BackQuote))
        {
            ishowWindow = !ishowWindow;
            if (ishowWindow)
            {
                console = new ConsoleTestWindows.ConsoleWindow();
                input   = new ConsoleTestWindows.ConsoleInput();
                console.Initialize();
                console.SetTitle("Test command");
                input.OnInputText += OnInputText;
                Application.logMessageReceived += HandleLog;
            }
            else
            {
                CloseConsoleWindow();
            }
            oldWindowState = ishowWindow;
        }
        // input update
        if (ishowWindow && null != input)
        {
            input.Update();
        }

        if (ishowWindow != oldWindowState && !ishowWindow)
        {
            CloseConsoleWindow();
        }
        oldWindowState = ishowWindow;
    }
Пример #2
0
    //
    // Create console window, register callbacks
    //
    void Awake()
    {
        DontDestroyOnLoad(gameObject);
        console.Initialize();
        console.SetTitle(System.Environment.CommandLine);

        input.OnInputText += OnInputText;

        Application.RegisterLogCallback(HandleLog);

        Debug.Log("Console Started");
    }
Пример #3
0
    //
    // Create console window, register callbacks
    //
    void Awake()
    {
        DontDestroyOnLoad(gameObject);

        console.Initialize();
        console.SetTitle("Test Server");

        input.OnInputText += OnInputText;

        Application.RegisterLogCallback(HandleLog);

        Debug.Log("Console Started");
    }