//Submits answer when button is pressed. public void submitAnswer() { //If the answer is correct... if (cSel1 && cSel2 && cSel3 && cSel4 && cSel5) { sAnswer.gameObject.SetActive(false); //Submit Button is replaced... nQuestion.gameObject.SetActive(true); //...By Next Question Button. hint.gameObject.SetActive(false); //hint button disables if question is answered correctly. corInc.text = "That's The Way!"; levelManager.addMuscPlaced(); rs.reportSelf(); if (correctFirstTry) { levelManager.testScoreAddition(); } //Evaluates the number of guesses and gives points accordingly. if (myGuess == THRESH0) { levelManager.score += SCORE1; } else if (myGuess == THRESH1) { levelManager.score += SCORE2; } else if (myGuess == THRESH2 && myHint == false) { levelManager.score += SCORE3; } else if (myGuess > THRESH3 && myHint == false) { levelManager.score += SCORE0; } else if (myHint == true) { levelManager.score += SCORE0; } } else { //Increases the guesses by 1 for each incorrect guess. myGuess++; rs.addGuess(); levelManager.attempts++; rs.reportSelf(); correctFirstTry = false; if (myHint == false) { corInc.text = "That's not what this muscle does!"; } } if (myGuess >= 2) { hint.gameObject.SetActive(true); //Reveal a button to give the answer... } }
//If X OR Y is true (but not both), make sure to reset to false. void clearBools() { if (!xPos || !yPos) { xPos = false; yPos = false; //Changes object to default size. transform.localScale = new Vector3(releaseScale, releaseScale, releaseScale); //If the object is NOT in the Object Pane... if (isGuessing) { hintSound(); levelManager.attempts++; rs.addGuess(); } } }
//Submits answer when button is pressed. public void submitAnswer() { //If the answer is correct... if (answers1.value == qr1.getValue()) { sAnswer.gameObject.SetActive(false); nQuestion.gameObject.SetActive(true); hint.gameObject.SetActive(false); //hint button disables if question is answered correctly. corInc.text = "You Got It!"; transform.gameObject.tag = "Placed"; levelManager.addobjPlaced(); rs.reportSelf(); //Evaluates the number of guesses and gives points accordingly. if (myGuess == THRESH0) { levelManager.score += SCORE1; } else if (myGuess == THRESH1) { levelManager.score += SCORE2; } else if (myGuess == THRESH2 && myHint == false) { levelManager.score += SCORE3; } else if (myGuess > THRESH3 && myHint == false) { levelManager.score += SCORE0; } else if (myHint == true) { levelManager.score += SCORE0; } } else if (answers1.value != qr1.getValue() && answers1.value != 0) { //Increases the guesses by 1 for each incorrect guess. myGuess++; if (SceneManager.GetActiveScene().name != "UpperArm6B") { rs.addGuess(); } else if (SceneManager.GetActiveScene().name == "UpperArm6B") { rs.addQguess(); } levelManager.attempts++; rs.reportSelf(); if (myHint == false) { corInc.text = "Please try again."; } } else if (answers1.value == 0) { //If player selects the null answer, change the text. if (myHint == false) { corInc.text = "Please select an answer before submitting."; } } if (myGuess >= THRESH2) { hint.gameObject.SetActive(true); //Reveal a button to give the answer... } }