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