Skip to content

Commit

Permalink
Fixed addressable build failing on Addressable 1.17.17+ (#262)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhouxinwei97 authored May 20, 2021
1 parent 947c8b8 commit f0e18ea
Show file tree
Hide file tree
Showing 3 changed files with 1,933 additions and 1,936 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,11 @@ public static void BuildProject()
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)
{
Expand Down
Loading

0 comments on commit f0e18ea

Please sign in to comment.