void shufflePossibleAnswersMCQ(PossibleAnswer[] possibleAnswers) { //for mcq, make sure only one answer is selected ... for (int t = 0; t < possibleAnswers.Length; t++) { PossibleAnswer tmp = possibleAnswers[t]; int r = Random.Range(t, possibleAnswers.Length); possibleAnswers[t] = possibleAnswers[r]; possibleAnswers[r] = tmp; } }
void AddClickEventLogic(GameObject answerPanel, PossibleAnswer answer) { //add custom data to the button ... answerPanel.AddComponent <CustomObjectData>().possibleAnswer = answer; }
void SetAnswerText(GameObject answerPanel, PossibleAnswer answer) { answerPanel.GetComponentInChildren <TextMesh>().text = CreatePanelText(answer.answer); }