public void ShowAnswers() { // LoopThroughScenarios(); SubScenario currentSub = scenarios[_currentScenario].GetSub(); _scenarioText.text = currentSub.GetText(); // check if the end of the scenario has been reached if (currentSub.GetIsEnd()) { answer1Btn.gameObject.SetActive(false); // button you won / failed. Return to home answer2Btn.onClick.RemoveAllListeners(); answer2Btn.onClick.AddListener(delegate { FinishGame(); }); _answerButton2.text = "finish game"; } else { _answers = currentSub.GetAnswers(); _answerButton1.text = _answers[0].Get_answerText(); _answerButton2.text = _answers[1].Get_answerText(); } }
public void ClickOn() { SubScenario currentSub = scenarios[_currentScenario].GetSub(); _answers = currentSub.GetAnswers(); if (_currentButtonId == 1) { scenarios[_currentScenario].SetCurrentSub(_answers[0].Get_nextScenario()); } else { scenarios[_currentScenario].SetCurrentSub(_answers[1].Get_nextScenario()); } ShowAnswers(); }