UnityEditor.EditorJsonUtility.ToJson C# (CSharp) Method

ToJson() public static method

Generate a JSON representation of an object.

public static ToJson ( object obj ) : string
obj object The object to convert to JSON form.
return string
        public static string ToJson(object obj)
        {
            return ToJson(obj, false);
        }

Same methods

EditorJsonUtility::ToJson ( object obj, bool prettyPrint ) : string

Usage Example

 public static string WriteCustom <T>(T val)
 {
     return(CustomPrefix <T>() + EditorJsonUtility.ToJson(val));
 }
All Usage Examples Of UnityEditor.EditorJsonUtility::ToJson