You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
854 B
29 lines
854 B
2 years ago
|
using System;
|
||
|
using UnityEngine;
|
||
|
|
||
|
namespace UnityEditor.ShaderGraph.Serialization
|
||
|
{
|
||
|
static class MultiJson
|
||
|
{
|
||
|
public static void Deserialize<T>(T objectToOverwrite, string json, JsonObject referenceRoot = null, bool rewriteIds = false) where T : JsonObject
|
||
|
{
|
||
|
var entries = MultiJsonInternal.Parse(json);
|
||
|
if (referenceRoot != null)
|
||
|
{
|
||
|
MultiJsonInternal.PopulateValueMap(referenceRoot);
|
||
|
}
|
||
|
MultiJsonInternal.Deserialize(objectToOverwrite, entries, rewriteIds);
|
||
|
}
|
||
|
|
||
|
public static string Serialize(JsonObject mainObject)
|
||
|
{
|
||
|
return MultiJsonInternal.Serialize(mainObject);
|
||
|
}
|
||
|
|
||
|
public static Type ParseType(string typeString)
|
||
|
{
|
||
|
return MultiJsonInternal.ParseType(typeString);
|
||
|
}
|
||
|
}
|
||
|
}
|