예제 #1
0
    // End the game
    public void EndGame()
    {
        // stop spawning destructoids
        gameRunning = false;

        // fade out all in-game UI and disconnect the EEG device
        scoreUI.FadeOut();
        if (playMode != 0)
        {
            mwmController.Disconnect();
            connectionUI.FadeOut();
            sliderUI.FadeOut();
        }

        // stop all the destructoids from moving
        GameObject[] destructoids = GameObject.FindGameObjectsWithTag("Destructoid");
        foreach (GameObject destructoid in destructoids)
        {
            destructoid.GetComponent <Rigidbody>().velocity = Vector3.zero;
        }
        // return back to the main menu, the game ended naturally
        GameObject endGamePanel = GameObject.Find("EndGamePanelNoError");

        endGamePanel.GetComponent <EndScreen>().UpdateStats();
        endGamePanel.GetComponent <EndScreen>().FadeIn();
    }
예제 #2
0
    void OnGUI()
    {
        GUILayout.BeginHorizontal();


        if (GUILayout.Button("Connect"))
        {
            controller.Connect();
        }
        if (GUILayout.Button("DisConnect"))
        {
            controller.Disconnect();
            indexSignalIcons = 1;
        }

        GUILayout.Space(Screen.width - 250);
        //GUILayout.Label(signalIcons[indexSignalIcons]);

        GUILayout.EndHorizontal();


        GUILayout.Label("PoorSignal:" + poorSignal1);
        GUILayout.Label("Attention:" + attention1);
        GUILayout.Label("Meditation:" + meditation1);
    }