how to use json in unity

string json = JsonUtility.ToJson(myObject);
// json now contains: '{"level":1,"timeElapsed":47.5,"playerName":"Dr Charles Francis"}'

5
3
Lou 65 points

                                    MyClass myObject = new MyClass();
myObject.level = 1;
myObject.timeElapsed = 47.5f;
myObject.playerName = "Dr Charles Francis";

5 (3 Votes)
0
3
1
S. Cassidy 75 points

                                    myObject = JsonUtility.FromJson<MyClass>(json);

3 (1 Votes)
0
Are there any code examples left?
Create a Free Account
Unlock the power of data and AI by diving into Python, ChatGPT, SQL, Power BI, and beyond.
Sign up
Develop soft skills on BrainApps
Complete the IQ Test
Relative searches
json,net for unity how to use json net for unity json library unity json.net with unity json unity tutorial read json data unity c# unity json unity object to json import json to unity json.net unity example how to create json in unity c# json unity how to use json file in unity json net unity how to write to json c# unity how to create a json file in unity json usage unity load json into unity data to json unity unity how to load json unity c# json object in object json files in unity acess json unity how to use json in unity unity JSON example how to use json unity reading data from json unity unity json.net unity load json read json unity how to get json file using unity json.net unity json c# unity json unity example simple json unity example Unity class t json json to unity code how to use jsonObject in unity unity jsonn json utility for json unity how to create json file in unity use json unity how to load a json file in unity unity c# json unity json {"":[]} unity simple json how to create json file unity using json in unity unity json with " handle json unity how to use json files in unity json object unity json for unity Get json object C# unity get json information unity json file unity unity script json json utility unity unity json tutorial unity using json use json in unity json (unity) script example json (unity) json? (unity) read json object unity json to unity get json unity json in unity json and unity unity from json using json.net with unity JSON .NET for Unity json .net for unity example simple json unity unity json json unity
Made with love
This website uses cookies to make IQCode work for you. By using this site, you agree to our cookie policy

Welcome Back!

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign in
Recover lost password
Or log in with

Create a Free Account

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign up
Or sign up with
By signing up, you agree to the Terms and Conditions and Privacy Policy. You also agree to receive product-related marketing emails from IQCode, which you can unsubscribe from at any time.
Creating a new code example
Code snippet title
Source