Exemplo n.º 1
0
        public void OnButtonBackClicked(IUISelectable uiButton)
        {
            uiButton.OnClick();

            // Load main menu scene
            GameManager.Instance.GameManagerState.StateChange(EGameScenes.MainMenu);
        }
Exemplo n.º 2
0
        public void OnButtonSettingsClicked(IUISelectable uiButton)
        {
            uiButton.OnClick();

            // Load settings scene
            GameManager.Instance.GameManagerState.StateChange(EGameScenes.SettingsMenu);
        }
Exemplo n.º 3
0
        public void OnButtonHowToPlayClicked(IUISelectable uiButton)
        {
            uiButton.OnClick();

            // Load how to play scene
            GameManager.Instance.GameManagerState.StateChange(EGameScenes.HowToPlayMenu);
        }
Exemplo n.º 4
0
        public void OnButtonTestLevelClicked(IUISelectable uiButton)
        {
            uiButton.OnClick();

            // Load test level scene
            GameManager.Instance.GameManagerState.StateChange(EGameScenes.TestLevel);
        }
Exemplo n.º 5
0
        public void OnButtonLevelsClicked(IUISelectable uiButton)
        {
            uiButton.OnClick();

            // Load levels scene
            GameManager.Instance.GameManagerState.StateChange(EGameScenes.LevelsMenu);
        }
Exemplo n.º 6
0
        public void OnButtonQuitClicked(IUISelectable uiButton)
        {
            uiButton.OnClick();

            Debug.Log("QUIT");

            Application.Quit();
        }
Exemplo n.º 7
0
        public void OnButtonMenuClicked(IUISelectable uiButton)
        {
            uiButton.OnClick();

            GameManager.Instance.ManagePause();

            // Back to main menu
            GameManager.Instance.GameManagerState.StateChange(EGameScenes.MainMenu);
        }
Exemplo n.º 8
0
        public void OnToggleFullScreenClicked(IUISelectable uiToggle)
        {
            uiToggle.OnClick();

            // Change fullscreen mode
            Screen.fullScreen = !Screen.fullScreen;
            // Set toggle
            uiToggle.Selectable.GetComponent <UIToggle>().SetToggle(Screen.fullScreen);
        }
Exemplo n.º 9
0
        public void OnButtonRightClicked(IUISelectable uiButton)
        {
            uiButton.OnClick();

            // Browse screen slides
            if (_currentSlideIndex + 1 < _howToPlaySlides.Length)
            {
                // Set index to next slide
                _currentSlideIndex++;
                // Set current index slide active only
                for (int i = 0; i < _howToPlaySlides.Length; i++)
                {
                    if (i == _currentSlideIndex)
                    {
                        _howToPlaySlides[i].SetActive(true);
                    }
                    else
                    {
                        _howToPlaySlides[i].SetActive(false);
                    }
                }
                // Manage left/right buttons
                if (_currentSlideIndex == _howToPlaySlides.Length - 1)
                {
                    // At the last slide disable right button
                    _uiNavigation.Selectables[0].gameObject.SetActive(false);
                    // Select back button
                    _uiNavigation.Selectables[2].Select();
                    _uiNavigation.CurrentSelectableID = 2;

                    // Controller slide
                    if (GameManager.Instance.GameController is Assets.Scripts.GameController.PS3GameController)
                    {
                        _controlsSlides[1].SetActive(true);
                    }
                    else if (GameManager.Instance.GameController is Assets.Scripts.GameController.PS4GameController)
                    {
                        _controlsSlides[2].SetActive(true);
                    }
                    else if (GameManager.Instance.GameController is Assets.Scripts.GameController.PSPGameController)
                    {
                        _controlsSlides[3].SetActive(true);
                    }
                    else
                    {
                        // Keyboard
                        _controlsSlides[0].SetActive(true);
                    }
                }
                else
                {
                    _uiNavigation.Selectables[1].gameObject.SetActive(true);
                    _uiNavigation.Selectables[0].gameObject.SetActive(true);
                }
            }
        }
Exemplo n.º 10
0
        public void OnButtonRightVolumeClicked(IUISelectable uiButton)
        {
            uiButton.OnClick();

            // Set AudioMixer volume up
            GameManager.Instance.AudioMixerController.SetVolume(CustomClasses.EAudioMixerVolume.Up);

            // Set volume slider value
            _volumeSlider.value = GameManager.Instance.AudioMixerController.GetCurrentVolume01();
        }
Exemplo n.º 11
0
        public void OnButtonLeftResolutionClicked(IUISelectable uiButton)
        {
            uiButton.OnClick();

            if (_currentScreenResolutionIndex != 0)
            {
                // Change current resolution index
                _currentScreenResolutionIndex--;
                // Change resolution
                Screen.SetResolution(
                    Screen.resolutions[_currentScreenResolutionIndex].width,
                    Screen.resolutions[_currentScreenResolutionIndex].height,
                    _uiNavigation.Selectables[1].GetComponent <Toggle>().isOn);
                // Set current resolution option text
                _resolutionOptionText.text = _formattedScreenResolutions[_currentScreenResolutionIndex];
            }
        }
Exemplo n.º 12
0
        public void OnButtonLeftClicked(IUISelectable uiButton)
        {
            uiButton.OnClick();

            // Browse screen slides
            if (_currentSlideIndex - 1 >= 0)
            {
                // Set index to previous slide
                _currentSlideIndex--;
                // Set current index slide active only
                for (int i = 0; i < _howToPlaySlides.Length; i++)
                {
                    if (i == _currentSlideIndex)
                    {
                        _howToPlaySlides[i].SetActive(true);
                    }
                    else
                    {
                        _howToPlaySlides[i].SetActive(false);
                    }
                }
                // Manage left/right buttons
                if (_currentSlideIndex == 0)
                {
                    // At the first slide disable left button
                    _uiNavigation.Selectables[1].gameObject.SetActive(false);
                    // Select right button
                    _uiNavigation.Selectables[0].Select();
                    _uiNavigation.CurrentSelectableID = 0;
                }
                else
                {
                    _uiNavigation.Selectables[1].gameObject.SetActive(true);
                    _uiNavigation.Selectables[0].gameObject.SetActive(true);
                }
            }
        }
Exemplo n.º 13
0
        public void OnButtonResumeClicked(IUISelectable uiButton)
        {
            uiButton.OnClick();

            GameManager.Instance.ManagePause();
        }