Hi, let me introduce this useful tool,
can export exemplars of complex typed objects to JSON string,
and build equal typed exemplars from this string, in one line.
For example you have two classes like:
public class Parent
{
public Child selected;
public List<Child> children = new List<Child>();
}
public class Child
{
public Parent parent;
public bool selected;
public string name;
public Vector2 position;
}
So, using this tool you may convert exemplar of Parent with all its children in one line:
string jsonString = Converter.ToJson(parent, true);
and after get equal object with all children in one line, too
Parent clone = Converter.FromJson<Parent>(jsonString);
It may work with third-party json library you prefer.
Package includes MiniJson library for exampe.
The product is at JSON to C# typed object one line converter | Integration | Unity Asset Store.
The api and other info are at JSON and XML C# Deserializer and Serializer for Unity3d
Hope this tool helps you!