Serializes the given object to json asset. The result asset file path. The obj to serialize. True if saving failed, otherwise false.
(string outputPath, object obj)
| 976 | /// <param name="obj">The obj to serialize.</param> |
| 977 | /// <returns>True if saving failed, otherwise false.</returns> |
| 978 | public static bool SaveJsonAsset(string outputPath, object obj) |
| 979 | { |
| 980 | if (obj == null) |
| 981 | throw new ArgumentNullException(); |
| 982 | string str = JsonSerializer.Serialize(obj); |
| 983 | return Internal_SaveJsonAsset(outputPath, str, obj.GetType().FullName); |
| 984 | } |
| 985 | |
| 986 | /// <summary> |
| 987 | /// Cooks the mesh collision data and saves it to the asset using <see cref="CollisionData"/> format. action cannot be performed on a main thread. |