Add support for asset bundles without an architecture suffix

Unity requires specifying the architecture when building asset bundles as part of BuildTarget. While compatibility between targets isn't guaranteed, in practice there are no differences between architectures.

<!-- ps-id: 49397d5b-21fc-4201-a0d6-e0c2f9627bf3 -->
This commit is contained in:
js6pak committed 2024-08-01 03:14:33 +02:00
1 parent 86b5a29b4e
commit 127f48fb1f
3 files changed
+67 -35

No files matched your search

+4 -4
View File
@@ -69,14 +69,14 @@ internal static class Build
}
}
private static string GetTargetName(BuildTarget target)
private static string GetTargetName(BuildTarget target, bool includeArchitecture = false)
{
return target switch
{
BuildTarget.StandaloneWindows => "win-x86",
BuildTarget.StandaloneWindows64 => "win-x64",
BuildTarget.StandaloneWindows => includeArchitecture ? "win-x86" : "win",
BuildTarget.StandaloneWindows64 => includeArchitecture ? "win-x64" : "win",
BuildTarget.Android => "android",
BuildTarget.StandaloneLinux64 => "linux-x64",
BuildTarget.StandaloneLinux64 => includeArchitecture ? "linux-x64" : "linux",
_ => throw new ArgumentOutOfRangeException(nameof(target), target, null),
};
}