Complete the code to convert an object to a JSON string using Unity's JsonUtility.
string json = JsonUtility.[1](playerData);JsonUtility.ToJson converts an object to a JSON string.
Complete the code to convert a JSON string back to an object of type PlayerData.
PlayerData player = JsonUtility.[1]<PlayerData>(jsonString);JsonUtility.FromJson converts a JSON string back to an object.
Fix the error in the code to correctly deserialize a JSON string into a PlayerData object.
PlayerData player = JsonUtility.[1](jsonString);FromJson is a generic method and requires the type in angle brackets to deserialize correctly.
Fill both blanks to create a JSON string from a PlayerData object and then parse it back.
string json = JsonUtility.[1](player); PlayerData newPlayer = JsonUtility.[2]<PlayerData>(json);
First, use ToJson to convert the object to JSON, then FromJson to convert JSON back to the object.
Fill all three blanks to serialize a PlayerData object with pretty print enabled and then deserialize it.
string json = JsonUtility.[1](player, [2]); PlayerData loadedPlayer = JsonUtility.[3]<PlayerData>(json);
Use ToJson with the second argument true to enable pretty print, then FromJson to deserialize.