From the course: Unity 5: Build a Character Dialogue System

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Write the JSON file

Write the JSON file - Unity Tutorial

From the course: Unity 5: Build a Character Dialogue System

Start my 1-month free trial

Write the JSON file

- [Instructor] We're going to be using json for the dialog information in our narrative system. Even though we're not hitting an API or a web service, it's still a great place to dive into the json structure, and how to handle reading and mapping data to custom objects. Go ahead and open up your favorite text editor program. I'm going to be using Atom, which you can download for free at atom.io. Once you've opened up the application, a new file should've been created for you. If it hasn't, go up to the toolbar, and select File, New File. Even though it's blank, we're going to Control + S to save the file and name it Event1.json. Hit Save. The .json file extension is extremely important. The basics of json are pretty simple. Brackets denote an array. Curly braces denote an object or a dictionary, depending on what languages you are already familiar with. Our json structure is going to have a very specific schema. It's going to consist of a top level NarrativeEvent. Each NarrativeEvent…

Contents