Match Level 2 With Level 2 questions and answers?
I cannot get the Level 2 answers to display during Level 2, instead I am getting the same Q&A for every round. I have a System.Serializable set up and a return allRoundData[0] in the DataController which is why Level 1 questions are being displayed.
How would I fix allRoundData[0] so I can make the data align with the Level.? Or how would I add a new function that will break up the System.serializable so I can put the specific Q&A with the specific Level?
If this Is not worded right, just let me know and I'll explain, but I REALLY need help!
Answer by Mentoliptus · Feb 09, 2017 at 09:40 AM
As you said, allRoundData[0]
will always return the first element so you should definitely not hard-code the index 0 but you should use allRoundData[levelNumber - 1]
to get the correct level data. Using you existing design, levelNumber
could be a public variable in the DataController
that is set for each level in the editor (since you use a separate scene for each level).
If I am not clear maybe you should show the code of the DataController
class.
Your answer
Follow this Question
Related Questions
Round 2 Help in Quiz Game 0 Answers
How to pass in an Integer 1 Answer
Best way to set up a player object 0 Answers