IEnumerator showButton(KeypadButtonScript keyButton, float waitTime, float displayTime) { yield return(new WaitForSeconds(waitTime)); keyButton.displayPress(true); yield return(new WaitForSeconds(displayTime)); keyButton.displayPress(false); }
public void buttonInteracted(KeypadButtonScript keypadButtonScript) { if (!gotAnswer()) { if (keypadButtonScript == buttons[necessaryButtonInteraction[actualStep]]) { // reached end if (actualStep >= sizeOfGame - 1) { // PRINT ANSWER displayOnCorrectAnswer.SetActive(true); } else { if (actualStep >= necessaryButtonInteraction.Count - 1) { Debug.Log("Need more"); // more steps addRandomButton(); runPresentation(); actualStep = 0; } else { actualStep++; } } } else { Debug.Log("Wrong! Resetting"); actualStep = 0; // no, error, reset clearNecessaryButtons(); wrongAnswerDisplay(); addRandomButton(); runPresentation(); } } else { Debug.Log("Answer gotten"); } }