private void updateLogicStep() { LogicStep currLogicStep = logicSteps[currStep]; currDialogue = currLogicStep.GetDialogue(); currDialogueIndx = 0; updateDialogue(); // if there is a clue or choice to be made, cannot go to next logic step showPopup = currLogicStep.GetClue() != null || currLogicStep.GetCorrectChoice() > -1; }
/// <summary> /// Select a choice /// </summary> /// <param name="choice"> Index of the choice</param> public void SelectChoice(int choice) { LogicStep currLogicStep = logicSteps[currStep]; int correctChoice = currLogicStep.GetCorrectChoice(); ChoicePopup.SetActive(false); showPopup = false; if (choice != correctChoice) { // selected wrong choice wrongAnswer = true; updateWrongDialogue(); } }
/// <summary> /// Determine if the player selected the correct choice /// </summary> /// <param name="choice">Choice that the player selected</param> /// <param name="logicStep">Step of the Logic System</param> /// <returns>True if the choice is the correct one, false otherwise</returns> public static bool DidSelectCorrectChoice(int choice, LogicStep logicStep) { return(choice == logicStep.GetCorrectChoice()); }