//Closes question Panel and lowers the number of startObjects. //Will return to game unless startObjects reaches 0, in which case the results display. public void nextQuestion() { if (quizPopup.getCanvasLength() >= 2) { int q = quizPopup.getQuestionN(); quizPopup.setCanvas(q, false); quizPopup.setCanvas(++q, true); quizPopup.reduceCanvasLength(); quizPopup.nextQuestionN(); } else { transform.parent.tag = "Placed"; rs.reportSelf(); quizPopup.isClickable = false; quizPopup.answered = true; quizPopup.setAlpha(); if (SceneManager.GetActiveScene().name != "UpperArm6B") { levelManager.noObjections = true; //Make other panels openable again. } levelManager.canvasOpen = false; this.gameObject.SetActive(false); //Reduce the number of objects remaining by one. levelManager.startObjects--; //levelManager.addMuscPlaced (); } }
//Closes question panel and lowers the number of startObjects. //Will return to game unless startObjects reaches 0, in which case the results display. public void nextQuestion() { if (quizPopup.getCanvasLength() >= 2) { int q = quizPopup.getQuestionN(); quizPopup.setCanvas(q, false); quizPopup.setCanvas(++q, true); quizPopup.reduceCanvasLength(); quizPopup.nextQuestionN(); } else { transform.parent.tag = "Placed"; rs.reportSelf(); quizPopup.isClickable = false; quizPopup.answered = true; quizPopup.setAlpha(); if (statTracking.identifyLevel() != "Q5") { levelManager.noObjections = true; //Make other panels openable again. } this.gameObject.SetActive(false); //Reduce the number of objects remaining by one levelManager.startObjects--; levelManager.addobjPlaced(); } }
//When the mouse button is released... void OnMouseUp() { if (isClickable && levelManager.gethasStarted() == true && !levelManager.canvasOpen && levelManager.noObjections) { //Enable the Sprite Hint button when guesses exceed 11. May need to be redone. if (rs.getGuesses() >= 11) { hint2Toggle.gameObject.SetActive(true); } getPosx(); //Get the X position and check compared to the correct X position. getPosy(); //Get the Y position and check compared to the correct Y position. clearBools(); //If incorrect, ensure that the booleans are cleared. rs.reportSelf(); //Updates the reportSelf script with the number of guesses, whether the object was placed, and if a hint was used. if (xPos && yPos) //If the X and Y positions are both correct... { hintBox.enabled = false; //Turn off the hint box if it was on. polyCol.enabled = false; //Disable the polygon collider so it's not in any other objects' way. hintBox.color = new Color(1f, 1f, 1f, 0f); //Clears hint box if it is active. setPos(); //Lock object in place if X AND Y positions are in place. hint2Toggle.gameObject.SetActive(false); //Set image hint button toggle to inactive. if (rs.getHint() == true) { rs.toggleHintFalse(); //Set hint 2 bool back to false. } //Opens up the first question when object is placed correctly. Note that for now, code is as if there will always be 1 question asked. if (normal) { quizP.setCanvas(0, true); //Open up the canvas levelManager.addobjPlaced(); } else { //Otherwise reduce the number of objects left to place by 1. levelManager.startObjects--; levelManager.addobjPlaced(); } } } }