Recall & Review
beginner
What is JSON serialization in Unity?
JSON serialization is the process of converting Unity objects or data into a JSON string format that can be saved or sent, and later converted back to objects.
Click to reveal answer
beginner
Which Unity class is commonly used for JSON serialization?Unity uses the JsonUtility class to convert objects to JSON strings and back.Click to reveal answer
beginner
How do you convert an object to a JSON string in Unity?
Use JsonUtility.ToJson(yourObject) to get a JSON string representing your object.
Click to reveal answer
beginner
How do you convert a JSON string back to an object in Unity?
Use JsonUtility.FromJson<T>(jsonString) where T is the type of the object you want to create.
Click to reveal answer
intermediate
What is a limitation of Unity's JsonUtility for serialization?
JsonUtility only works with classes or structs marked as serializable and does not support dictionaries or complex types well.
Click to reveal answer
Which method converts an object to a JSON string in Unity?
✗ Incorrect
JsonUtility.ToJson() converts an object to a JSON string.
What must a class have to be serialized by JsonUtility in Unity?
✗ Incorrect
Classes must be marked with [Serializable] to be serialized by JsonUtility.
Which of these is NOT supported well by Unity's JsonUtility?
✗ Incorrect
Dictionaries are not supported well by JsonUtility.
How do you deserialize a JSON string to an object of type PlayerData?
✗ Incorrect
Use JsonUtility.FromJson(jsonString) to deserialize.
What is the output type of JsonUtility.ToJson()?
✗ Incorrect
JsonUtility.ToJson() returns a string containing JSON text.
Explain how JSON serialization works in Unity using JsonUtility.
Think about converting objects to strings and back.
You got /4 concepts.
What are some limitations of Unity's JsonUtility for JSON serialization?
Consider what data structures JsonUtility cannot handle well.
You got /4 concepts.