2 Commits
Author SHA1 Message Date
ds5678 c34f7447b8 Bump version
* Add constructors to EngineResourceData and UnityPackageData
* Make UnityPackageData.Assets a dictionary
2024-01-16 00:35:31 -05:00
ds5678 c009d0cab9 Use string version in UnityPackageData and bump version 2024-01-15 20:36:30 -05:00
3 changed files with 16 additions and 4 deletions

No files matched your search

@@ -9,7 +9,7 @@
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
<Authors>ds5678</Authors>
<Company>AssetRipper</Company>
<Version>1.0.1</Version>
<Version>1.0.3</Version>
<AssemblyVersion>$(Version)</AssemblyVersion>
<PackageId>AssetRipper.Mining.PredefinedAssets</PackageId>
<PackageTags>C# Unity</PackageTags>
@@ -4,6 +4,10 @@ namespace AssetRipper.Mining.PredefinedAssets;
public readonly record struct EngineResourceData(Dictionary<long, Object> DefaultResources, Dictionary<long, Object> ExtraResources)
{
public EngineResourceData() : this(new(), new())
{
}
public readonly string ToJson()
{
return JsonSerializer.Serialize(this, InternalSerializerContext.Default.EngineResourceData);
@@ -10,19 +10,27 @@ namespace AssetRipper.Mining.PredefinedAssets;
/// File extensions are not included in any names.
/// </remarks>
/// <param name="Name">The name of this Unity package.</param>
/// <param name="Version">The version of this Unity package. Only applicable if <paramref name="UsedInPackageJson"/> is true.</param>
/// <param name="Version">The version or git url of this Unity package. Only applicable if <paramref name="UsedInPackageJson"/> is true.</param>
/// <param name="UsedInPackageJson">If true, this Unity package should be referenced in the project's package json file.</param>
/// <param name="Assemblies">A dictionary of compiled dll assemblies in the package.</param>
/// <param name="Scripts">A dictionary of loose cs scripts in the package. Assembly name : { Full name : Guid }</param>
/// <param name="Assets">A dictionary of assets in the package.</param>
public readonly record struct UnityPackageData(
string Name,
Version Version,
string Version,
bool UsedInPackageJson,
Dictionary<string, UnityGuid> Assemblies,
Dictionary<string, Dictionary<string, UnityGuid>> Scripts,
KeyValuePair<Object, UnityGuid>[] Assets)
Dictionary<Object, UnityGuid> Assets)
{
public UnityPackageData(string name, string version, bool usedInPackageJson) : this(name, version, usedInPackageJson, new(), new(), new())
{
}
public UnityPackageData(string name, string version = "") : this(name, version, string.IsNullOrEmpty(version))
{
}
public readonly string ToJson()
{
return JsonSerializer.Serialize(this, InternalSerializerContext.Default.UnityPackageData);