From dc662af493e9e45cb51b9a5d2cc03719e3efb151 Mon Sep 17 00:00:00 2001 From: XtraCube <72575280+XtraCube@users.noreply.github.com> Date: Sat, 25 Jan 2025 11:43:23 -0500 Subject: [PATCH 1/2] Use Unity to determine platform instead of dotnet --- Reactor.Benchmarks/packages.lock.json | 2 +- Reactor.Example/packages.lock.json | 2 +- Reactor/Utilities/AssetBundleManager.cs | 23 ++++++----------------- 3 files changed, 8 insertions(+), 19 deletions(-) diff --git a/Reactor.Benchmarks/packages.lock.json b/Reactor.Benchmarks/packages.lock.json index ce586c6..f2ad944 100644 --- a/Reactor.Benchmarks/packages.lock.json +++ b/Reactor.Benchmarks/packages.lock.json @@ -1152,4 +1152,4 @@ } } } -} +} \ No newline at end of file diff --git a/Reactor.Example/packages.lock.json b/Reactor.Example/packages.lock.json index 0e8b75b..2bd439f 100644 --- a/Reactor.Example/packages.lock.json +++ b/Reactor.Example/packages.lock.json @@ -922,4 +922,4 @@ } } } -} +} \ No newline at end of file diff --git a/Reactor/Utilities/AssetBundleManager.cs b/Reactor/Utilities/AssetBundleManager.cs index afc86cd..cc873b2 100644 --- a/Reactor/Utilities/AssetBundleManager.cs +++ b/Reactor/Utilities/AssetBundleManager.cs @@ -33,24 +33,13 @@ public static class AssetBundleManager /// Target name of the current system. public static string GetTargetName(bool includeArchitecture) { - string operatingSystem; - - if (OperatingSystem.IsWindows()) - { - operatingSystem = "win"; - } - else if (OperatingSystem.IsLinux()) - { - operatingSystem = "linux"; - } - else if (OperatingSystem.IsAndroid()) + var operatingSystem = Application.platform switch { - operatingSystem = "android"; - } - else - { - throw new PlatformNotSupportedException(); - } + RuntimePlatform.WindowsPlayer => "win", + RuntimePlatform.LinuxPlayer or RuntimePlatform.OSXPlayer => "linux", + RuntimePlatform.Android => "android", + _ => throw new PlatformNotSupportedException(), + }; if (!includeArchitecture) { From 8369bcf32cafed3e385dd1709374e348e9066bb4 Mon Sep 17 00:00:00 2001 From: XtraCube <72575280+XtraCube@users.noreply.github.com> Date: Sat, 15 Feb 2025 10:39:57 -0500 Subject: [PATCH 2/2] add WSAPlayer --- Reactor/Utilities/AssetBundleManager.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Reactor/Utilities/AssetBundleManager.cs b/Reactor/Utilities/AssetBundleManager.cs index cc873b2..67579dd 100644 --- a/Reactor/Utilities/AssetBundleManager.cs +++ b/Reactor/Utilities/AssetBundleManager.cs @@ -35,7 +35,7 @@ public static string GetTargetName(bool includeArchitecture) { var operatingSystem = Application.platform switch { - RuntimePlatform.WindowsPlayer => "win", + RuntimePlatform.WindowsPlayer or RuntimePlatform.WSAPlayerX86 => "win", RuntimePlatform.LinuxPlayer or RuntimePlatform.OSXPlayer => "linux", RuntimePlatform.Android => "android", _ => throw new PlatformNotSupportedException(),