Esempio n. 1
0
    /// <summary>
    /// Shows the main menu
    /// </summary>
    private void MainMenu()
    {
        // Reset and generate the level
        hoopArea.ResetHoops();

        // Set the state to "main menu"
        State = GameState.MainMenu;

        // Update the UI
        uiController.ShowBanner("");
        uiController.ShowButton("Start");
        uiController.ShowSlider(true);
        uiController.ShowPlayerPanel(false);
        uiController.ShowOpponentPanel(false);

        // Use the main camera, disable agent cameras
        mainCamera.gameObject.SetActive(true);
        player.agentCamera.gameObject.SetActive(false);
        opponent.agentCamera.gameObject.SetActive(false); // Never turn this back on

        // Reset the agents
        player.OnEpisodeBegin();
        opponent.OnEpisodeBegin();

        // Freeze the agents
        player.FreezeAgent();
        opponent.FreezeAgent();
    }