Exemplo n.º 1
0
 private void OnMistaken()
 {
     ChangeValue(_currentValue - 1);
     if (_currentValue == 0)
     {
         TriesEnded?.Invoke();
     }
 }
Exemplo n.º 2
0
    public void OnDestroyed(string predictionText)
    {
        _predictionText.text = predictionText;
        PlayerPrefs.SetString("LastPrediction", predictionText);

        int currentTries = PlayerPrefs.GetInt("Tries");

        PlayerPrefs.SetInt("Tries", ++currentTries);

        if (PlayerPrefs.GetInt("Tries") >= _maxTries)
        {
            TriesEnded?.Invoke();
        }
        else
        {
            _buttons.ActivateAllButtons();
        }
    }