Skip to content

Instantly share code, notes, and snippets.

@monry
Last active July 1, 2021 07:16
Show Gist options
  • Save monry/761da361f2ffc84eac18205b9d9fe2fd to your computer and use it in GitHub Desktop.
Save monry/761da361f2ffc84eac18205b9d9fe2fd to your computer and use it in GitHub Desktop.
using UnityEditor.AddressableAssets;
using UnityEditor.AddressableAssets.Settings;
using UnityEditor.Build;
using UnityEditor.Build.Reporting;
namespace PretendLand.Common.Editor
{
public class BuildAddressablesBeforeBuildPlayer : IPreprocessBuildWithReport
{
int IOrderedCallback.callbackOrder => 1;
void IPreprocessBuildWithReport.OnPreprocessBuild(BuildReport report)
{
AddressableAssetSettings.CleanPlayerContent(AddressableAssetSettingsDefaultObject.Settings.ActivePlayerDataBuilder);
AddressableAssetSettings.BuildPlayerContent();
}
}
}
{
"name": "PretendLandSports.Common.Addressables.Editor",
"references": [
"GUID:69448af7b92c7f342b298e06a37122aa"
],
"includePlatforms": [
"Editor"
],
"excludePlatforms": [],
"allowUnsafeCode": false,
"overrideReferences": false,
"precompiledReferences": [],
"autoReferenced": true,
"defineConstraints": [],
"versionDefines": [],
"noEngineReferences": false
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment