Beispiel #1
0
    public void HandleBackPause()
    {
        G4.LogEvent("PressButton", "BackPauseButton", "HasPressed", 1);

        // Builder Hit with all Event parameters.
        G4.LogEvent(new EventHitBuilder()
                    .SetEventCategory("PressButton")
                    .SetEventAction("BackPauseButton")
                    .SetEventLabel("HasPressed")
                    .SetEventValue(1));

        Debug.Log("Sent");
        ControlsUI.SetActive(false);
        QuitToMainUI.SetActive(false);
        InfoUI.SetActive(false);
        MainPauseUI.SetActive(true);
    }
Beispiel #2
0
    public void HandleBack()
    {
        G4.LogEvent("ResumeGame", "Unpaused", "Back", 1);

        // Builder Hit with all Event parameters.
        G4.LogEvent(new EventHitBuilder()
                    .SetEventCategory("ResumeGame")
                    .SetEventAction("Unpaused")
                    .SetEventLabel("Back")
                    .SetEventValue(1));

        Debug.Log("Sent");
        Time.timeScale = 1;
        QuitToMainUI.SetActive(false);
        ControlsUI.SetActive(false);
        MainPauseUI.SetActive(true);
        PauseMenuUI.SetActive(false);
        IsPaused = false;
    }
Beispiel #3
0
    /// <summary>
    /// OnPlayerDead event listener
    /// </summary>
    private void GameOver()
    {
        if (!_playerDead)
        {
            _playerDead = true;
            if (StartGameBtn != null && !StartGameBtn.activeSelf)
            {
                StartGameBtn.SetActive(true);
            }

            if (GameOverUI != null)
            {
                GameOverUI.SetActive(true);
            }

            if (ControlsUI != null)
            {
                ControlsUI.SetActive(true);
            }
        }
    }
Beispiel #4
0
    private void ChooseControlles()
    {
        if (keyBordAndMouse == true)
        {
            keyBordAndMouse = false;
            controller      = false;
            KeysPanel.SetActive(false);
            ControllerPanel.SetActive(false);
            ControlsUI.SetActive(true);
            back.Select();
        }

        if (controller == true)
        {
            keyBordAndMouse = false;
            controller      = false;
            KeysPanel.SetActive(false);
            ControllerPanel.SetActive(false);
            ControlsUI.SetActive(true);
            back.Select();
        }
    }
 public void ShowControls()
 {
     MainUI.SetActive(false);
     ControlsUI.SetActive(true);
     controlsActive = true;
 }
Beispiel #6
0
    // Update is called once per frame
    void Update()
    {
        if (Input.GetButtonDown("StartButton") && gameStarted == true)
        {
            if (GameIsPaused)
            {
                Resume();
            }
            else
            {
                Pause();
            }
        }

        if (Input.GetButtonDown("Cancel"))
        {
            ControlsUI.SetActive(false);
            MenuCheckUI.SetActive(false);
            myInputField.Select();
        }

        if ((P1Slider.value == MaxPoints || P2Slider.value == MaxPoints || P3Slider.value == MaxPoints || P4Slider.value == MaxPoints))
        {
            GameIsPaused = true;
            checkWinner();
            GameOverUI.SetActive(true);
            GameOverText.GetComponent <Text>().text = "Game Over\n\nThe " + role + " has been promoted";
            StartCoroutine(gameOver());
        }

        switch (PowerUp.pointPowerUp) //If a player collects a point power up
        {
        case 1:                       //Player 1
            P1Slider.value      += 0.25f;
            PowerUp.pointPowerUp = 0;
            break;

        case 2:     //Player 2
            P2Slider.value      += 0.25f;
            PowerUp.pointPowerUp = 0;
            break;

        case 3:     //Player 3
            P3Slider.value      += 0.25f;
            PowerUp.pointPowerUp = 0;
            break;

        case 4:     //Player 4
            P4Slider.value      += 0.25f;
            PowerUp.pointPowerUp = 0;
            break;
        }

        switch (TripWires.playerNum)
        {
        case 1:
            P1Slider.value     -= 0.25f;
            TripWires.playerNum = 0;
            break;

        case 2:
            P2Slider.value     -= 0.25f;
            TripWires.playerNum = 0;
            break;

        case 3:
            P3Slider.value     -= 0.25f;
            TripWires.playerNum = 0;
            break;

        case 4:
            P4Slider.value     -= 0.25f;
            TripWires.playerNum = 0;
            break;
        }

        switch (Dynamite.dynaPlayerNum)
        {
        case 1:
            P1Slider.value        -= 0.25f;
            Dynamite.dynaPlayerNum = 0;
            break;

        case 2:
            P2Slider.value        -= 0.25f;
            Dynamite.dynaPlayerNum = 0;
            break;

        case 3:
            P3Slider.value        -= 0.25f;
            Dynamite.dynaPlayerNum = 0;
            break;

        case 4:
            P4Slider.value        -= 0.25f;
            Dynamite.dynaPlayerNum = 0;
            break;
        }
    }
Beispiel #7
0
 public void Controls()
 {
     ControlsUI.SetActive(true);
 }