Posted August 21, 2019 by RevampedCobra73
Introduction
This week was much more successful than last. My task was split between several students; converting csv to Json, reading the Json, applying the Json to an object. My task this week was the second, getting a Json file that was formatted correctly to be able to be accessed through a script. I felt close to finding what I was after last week, something which turned out to be true, as I found a YouTube guide that taught me how to create a script that used a .Net library called LitJSON to handle conversions from and to Json strings. The guide also went into using LitJSON to call upon specific values under each ID assigned to an object. I used the guide to create a new Json file that contained all the data for both weapons and enemies, had correctly placed commas and such, and was formatted for easy readability/ editing.
Goals
Personnel
Technologies, tools, and resources used
Tasks undertaken
What we found out
Being more specific in my search to find what I was after turned out to be key in finding the guide used. Googling ‘Unity Json” would lead me to several tutorials related to saving and loading games (something I could potentially follow up on), whereas googling “Unity Json weapons” and “Unity Json data” lead me to the more useful guides.
Open issues/ risks
The easy accessibility/ editing of the Json file leaves it vulnerable to editing by the player. Finding a way of concealing this data from the player may be necessary. However, this may also be outside of our scope/ concern for now.
Recommendations
Follow the Json formatting I’ve used to create whatever fields/ data that we deem necessary to weapons and enemies. The one I created is an example. Enabling LitJSON in visual studio may be necessary. Guide available here.