Published on November 30, 2016 by Unity

Watch this video in context on the official Unity learn pages –
www.unity3d.com/learn/tutorials/topics/scripting/question-and-answer

In this live training session we will learn how to extend our basic Quiz Game created in session one to include: loading game data from an external JSON file, editor scripting to create a window for editing game data and very basic saving of player progress using PlayerPrefs.

Leave a Reply

12 Comments on "Quiz Game 2 – Questions and Answers [7/7] Live 2016/25/14"

Notify of
avatar

Daniel Aparicio
Guest
Daniel Aparicio
2 months 11 days ago

Is there a part 3 of this training? I'm stuck with android not reading json file too.

煌 Zalam
Guest
煌 Zalam
2 months 16 days ago

How i can change json code for android? When i convert to apk, json data or script data controller does not loaded. Srr for bad english :<

Poetry On Everyone's Mind
Guest
Poetry On Everyone's Mind
2 months 22 days ago

Excellent – thank you for this! Follow up questions … how might you go about randomizing the order the questions are presented, and randomizing the order the answers are displayed (without having dupes)? Oh and how about adding a second or third etc. round???

Daniel Aparicio
Guest
Daniel Aparicio
2 months 11 days ago

I was looking for this for about 2 days, thank you very much.

Poetry On Everyone's Mind
Guest
Poetry On Everyone's Mind
2 months 12 days ago

Just a follow up … never figured out how to implement the shuffle bag, but I was able to change how the questions come up by editing a line in GameController.cs from "QuestionData questionData = questionPool [questionIndex];" to "QuestionData questionData = questionPool [Random.Range(0, currentRoundData.questions.Length)];" Having a non-repeating solution wasn't that crucial for me since my quizzes are designed to be like study drills/practice for their given subjects 🙂

Poetry On Everyone's Mind
Guest
Poetry On Everyone's Mind
2 months 19 days ago

Gracias! Recently came over to unity from xcode, so my c# skills are still somewhat undeveloped, but I will look into what that shufflebag is all about and see about setting up a round variable. Thanks for the suggestions! Most likely will end up posting a question on stackoverflow 🙂

Unity
Guest
Unity
2 months 22 days ago

Thanks very much. You could look at a shuffle bag to do the randomization, here's a link: gamedevelopment.tutsplus.com/tutorials/shuffle-bags-making-random-feel-more-random–gamedev-1249The way the DataController is setup it's hardwired to have 1 round (index 0 in the array) but you could fairly easily write your own functions to make a variable for round number and a button to increment that instead of restarting the game when the round is over. Give it a try!

Sarcastic Toast
Guest
Sarcastic Toast
2 months 23 days ago

Is there a reason we use Json, instead of xml?

ZoidbergForPresident
Guest
ZoidbergForPresident
2 months 23 days ago

It's basically the same except that xml allows things like schemas but it's also much more verbose.

Владимир Кисиль
Guest
Владимир Кисиль
2 months 23 days ago

2016/25/14? 14?

gladiumcaeli
Guest
gladiumcaeli
2 months 24 days ago

Question does unity have a readme text document ? ( i know i can just create one and just drag and drop in the assets folder or create a new script just to fill it with text. But i was curious) awesome work btw 🙂

Titan Gtx1080
Guest
Titan Gtx1080
2 months 25 days ago

Pretty cool! could you make a serie on mobile development? it would be kinda cool i think!

wpDiscuz