Fixed addressable build failing on Addressable 1.17.17+ (#262)

This commit is contained in:
Zhou Xinwei 2021-05-20 23:51:54 +08:00 committed by GitHub
parent 947c8b8e20
commit f0e18ea3a5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 6 deletions

View File

@ -53,14 +53,11 @@ namespace UnityBuilderAction
if (addressableAssetSettingsType != null)
{
// ReSharper disable once PossibleNullReferenceException, used from try-catch
void CallAddressablesMethod(string methodName, object[] args) => addressableAssetSettingsType
.GetMethod(methodName, BindingFlags.Static | BindingFlags.Public)
.Invoke(null, args);
try
{
CallAddressablesMethod("CleanPlayerContent", new object[] { null });
CallAddressablesMethod("BuildPlayerContent", Array.Empty<object>());
addressableAssetSettingsType.GetMethod("CleanPlayerContent", BindingFlags.Static | BindingFlags.Public)
.Invoke(null, new object[] {null});
addressableAssetSettingsType.GetMethod("BuildPlayerContent", new Type[0]).Invoke(null, new object[0]);
}
catch (Exception e)
{

BIN
dist/index.js generated vendored

Binary file not shown.

BIN
dist/index.js.map generated vendored

Binary file not shown.