public void OnPausePlayButtonClick()
 {
     if (isPause)
     {
         isPause = false;
         OnPlayClick?.Invoke();
         pausePlayButtonImage.sprite = pauseSprite;
     }
     else
     {
         isPause = true;
         OnPauseClick?.Invoke();
         pausePlayButtonImage.sprite = playSprite;
     }
 }
Exemplo n.º 2
0
 public void OnPausePlayButtonClick()
 {
     // Alternating the call of two functions on one button
     if (isPause)
     {
         isPause = false;
         OnPlayClick?.Invoke();
         pausePlayButtonImage.sprite = pauseSprite;
     }
     else
     {
         isPause = true;
         OnPauseClick?.Invoke();
         pausePlayButtonImage.sprite = playSprite;
     }
 }
Exemplo n.º 3
0
    public void Init(int pCompletedLevelsCount, int pSelectedLevelIndex, int pTotalLevelsCount, bool pEnableHUDArrows)
    {
        _totalLevelCount = pTotalLevelsCount;
        _arrowsHUDHolder.SetActive(pEnableHUDArrows);
        if (pEnableHUDArrows)
        {
            _moveButtonLeft.onClick.AddListener(() => InputController.FireMoveEvent(Vector2Int.left));
            _moveButtonRight.onClick.AddListener(() => InputController.FireMoveEvent(Vector2Int.right));
            _moveButtonUp.onClick.AddListener(() => InputController.FireMoveEvent(Vector2Int.up));
            _moveButtonDown.onClick.AddListener(() => InputController.FireMoveEvent(Vector2Int.down));
        }

        _resetLevelButton.onClick.AddListener(() => OnResetLevelClick?.Invoke());
        _playButton.onClick.AddListener(() => OnPlayClick?.Invoke());
        _nextLevelButton.onClick.AddListener(onNextLevelClick);
        _backToMenuButton.onClick.AddListener(onBackToMenuClick);
        _chooseLevelDropdown.onValueChanged.AddListener(onDropdownValueChanged);
        RefreshChooseLevelDropdownOptions(pCompletedLevelsCount, pSelectedLevelIndex);
        ShowMainMenu();
    }
Exemplo n.º 4
0
 private void Awake()
 {
     _buttonPlay.onClick.AddListener(() => OnPlayClick?.Invoke());
     _buttonQuit.onClick.AddListener(() => OnQuitClick?.Invoke());
 }
Exemplo n.º 5
0
 private void Play()
 {
     playButton.interactable = false;
     OnPlayClick.Invoke();
     MenuCamera.SetActive(false);
 }