/// <summary> /// Displays a popup if the player selected the wrong Feynman diagram. /// </summary> /// <param name="error">The error to be displayed on the popup depending on the player's mistake.</param> public void DisplayErrorMessage(ErrorType errorType) { _errorParticles.SetActive(true); _errorParticles.GetComponentInChildren <Text>().text = _errorMessages.First(x => x.errorType == errorType).errorMessage; StartCoroutine(_maiaTopScreen.WaitGeneric(_errorPopupDuration, () => { _errorParticles.SetActive(false); })); }
private IEnumerator ReactionSelectedAnimation(bool correctDiagram) { _analysis = true; _analysisPopup.SetActive(true); yield return(new WaitForSeconds(_analysisDuration)); _analysisPopup.SetActive(false); if (correctDiagram) { _popupWin.SetActive(true); } else { _popupLose.GetComponentInChildren <Text>().text = _strike < _loseText.Length ? _loseText[_strike] : _loseText[_loseText.Length - 1]; _strike++; _popupLose.SetActive(true); StartCoroutine(_topScreen.WaitGeneric(_popupDuration, () => { _popupLose.SetActive(false); })); } _analysis = false; }