public void OnPausePlayButtonClick()
 {
     if (isPause)
     {
         isPause = false;
         OnPlayClick?.Invoke();
         pausePlayButtonImage.sprite = pauseSprite;
     }
     else
     {
         isPause = true;
         OnPauseClick?.Invoke();
         pausePlayButtonImage.sprite = playSprite;
     }
 }
Example #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;
     }
 }