A JSON Utils class which provides more robust json support across different Unity versions
More...
|
static T | FromJson< T > (string json) |
| Converts a string of json text to the specified type T. Note due to the limitations of Unity's json utility across different editor versions please use FromJsonArray<T>(string) for deserializing pure arrays or lists More...
|
|
static T[] | FromJsonArray< T > (string json) |
| Deserializes a pure T[] of objects T. This is not natively supported on all unity editors and so a workaround is implemented inside this method to achieve support which is provided by something more robust like Newtownsoft but which may not always be installed. More...
|
|
static List< T > | FromJsonList< T > (string json) |
| Deserializes a pure List<T> of objects T. This is not natively supported on all unity editors and so a workaround is implemented inside this method to achieve support which is provided by something more robust like Newtownsoft but which may not always be installed. More...
|
|
static string | ToJson (object obj) |
| Converts an object to a string of JSON More...
|
|
static string | ToJson (object obj, bool isPrettyPrint) |
| Converts an object to a string of JSON More...
|
|
A JSON Utils class which provides more robust json support across different Unity versions
◆ FromJson< T >()
static T TesseractTools.Core.JsonUtils.FromJson< T > |
( |
string |
json | ) |
|
|
static |
Converts a string of json text to the specified type T. Note due to the limitations of Unity's json utility across different editor versions please use FromJsonArray<T>(string) for deserializing pure arrays or lists
- Template Parameters
-
- Parameters
-
- Returns
◆ FromJsonArray< T >()
static T[] TesseractTools.Core.JsonUtils.FromJsonArray< T > |
( |
string |
json | ) |
|
|
static |
Deserializes a pure T[] of objects T. This is not natively supported on all unity editors and so a workaround is implemented inside this method to achieve support which is provided by something more robust like Newtownsoft but which may not always be installed.
- Template Parameters
-
- Parameters
-
- Returns
◆ FromJsonList< T >()
static List< T > TesseractTools.Core.JsonUtils.FromJsonList< T > |
( |
string |
json | ) |
|
|
static |
Deserializes a pure List<T> of objects T. This is not natively supported on all unity editors and so a workaround is implemented inside this method to achieve support which is provided by something more robust like Newtownsoft but which may not always be installed.
- Template Parameters
-
- Parameters
-
- Returns
◆ ToJson() [1/2]
static string TesseractTools.Core.JsonUtils.ToJson |
( |
object |
obj | ) |
|
|
static |
Converts an object to a string of JSON
- Parameters
-
obj | The object to convert to JSON |
- Returns
◆ ToJson() [2/2]
static string TesseractTools.Core.JsonUtils.ToJson |
( |
object |
obj, |
|
|
bool |
isPrettyPrint |
|
) |
| |
|
static |
Converts an object to a string of JSON
- Parameters
-
obj | The object to convert to JSON |
isPrettyPrint | Should this be formatted nicely or not? |
- Returns
The documentation for this class was generated from the following file:
- /github/workspace/src/UnityTools.App.Dev/Assets/Plugins/TesseractTools/Core/Runtime/Scripts/Utils/JsonUtils.cs