# Play Asset Delivery - Addressables
[![openupm](https://img.shields.io/npm/v/be.khepri.play.assetdelivery.addressables?label=openupm®istry_uri=https://package.openupm.com)](https://openupm.com/packages/be.khepri.pad-addressables/)
In short this package provides support for Googles' Play Asset Delivery (https://developer.android.com/guide/app-bundle/asset-delivery) to Addressables.
## Installation
Before adding the package to your project you will need to have the google registry added, you can do this by editing the `manifest.json`
```
"scopedRegistries": [
{
"name": "Game Package Registry by Google",
"url": "https://unityregistry-pa.googleapis.com",
"scopes": [
"com.google"
]
}
]
```
Next you can add the package to your project via the `OpenUPM`, the `Package Manager` or by manually editing the `manifest.json`
### Via OpenUPM
1. https://openupm.com/docs/getting-started
2. `openupm add be.khepri.play.assetdelivery.addressables -f`
note: `-f` is required as `openupm` can not install dependencies which are in a different scopedRegistry.
### Via Package Manager
1. Press ` + `
2. Select `Add package from git URL...`
3. url: `https://github.com/jelte/be.khepri.play.assetdelivery.addressables.git#1.0.0-rc2`
### Via manifest.json
```json
"be.khepri.play.assetdelivery.addressables": "https://github.com/jelte/be.khepri.play.assetdelivery.addressables.git#1.0.0-rc2",
```
## Configure Groups
`Play Asset Delivery` is not available for Remote asset groups.
### Content Packing and Loading
- **Bundle Mode**: `Pack Together`
- **Bundle Naming**: `Filename` or `Append Hash to Filename`
- **Asset Provider**: `Assets From Bundles Provider`
- **AssetBundle Provider**: `AssetPack Bundle Provider`
#### Synchronous Addressables
Traditionally, Addressables work Asynchronously. However, this package allows for synchronous loading of assets and asset bundles.
This relies on the assets to be pre-downloaded, before actually using the asset bundles and assets.
This is generally done during the initial launch of the game. Once downloaded to the device, loading assets synchronously is smooth.
*note: The process of Pre-downloading and updating asset bundles is not within the scope of this project at the this time.*
To enable synchronous loading, all that is need to be done as set the following settings:
- **Asset Provider**: `Assets From Bundles Provider (Sync)`
- **AssetBundle Provider**: `AssetPack Bundle Provider (Sync)`
The asset bundle provider is a hybrid provider, which allows for both synchronous as asynchronous loading.
The idea is that after the game has download the assetbundles to the device (either from remote, apk or `Play Asset Delivery`) asynchronously `AssetPackBundleSyncProvider.handleSynchronously` is set to `true`.
After which any attempt loading an asset bundle will be done synchronously. If you chose not to pre-download the assetbundles asynchronously, the your app will be blocked while downloading, which may lead to ANR's.
For more information on Synchronous loading please check out the sample provided by Unity at https://github.com/Unity-Technologies/Addressables-Sample
### Add Schema
The first step is to highlight which Addressable groups should be provided via `Play Asset Delivery` and which should be included in the build.
This is done by adding the `Play Asset Delivery` schema to the Addressable groups.
Once the schema is added all that is left is to select how the group is to be delivered by settings the `Delivery Mode`:
- **Do Not Package**: Included in the base build.
- **Install Time**: Installed along with the APK.
- **Fast Follow**: Downloaded shortly after.
- **On Demand**: Downloaded at some point late.
*(For more information see: https://developer.android.com/guide/app-bundle/asset-delivery)*
## Building Asset Packs
### Manual build process
1. **Build Addressables**: Before the AAB can be build, the `Addressables` asset bundles need to be build.
2. **Build Asset Pack config**: `Google` > `Create config for Addressables Groups`
3. **Build Android App Bundle**: `Google` > `Build Android App Bundle...`
*Note: Not tested yet*
### Scripted build process
Replace
```csharp
BuildReport buildReport = BuildPipeline.BuildPlayer(buildPlayerOptions);
```
with
```csharp
#if UNITY_ANDROID
if (!AssetPackBuilder.BuildBundleWithAssetPacks(buildPlayerOptions, EditorUserBuildSettings.androidBuildSubtarget, Addressables.BuildPath))
{
throw new Exception("BuildScript.Build Failed");
}
#else
BuildReport buildReport = BuildPipeline.BuildPlayer(buildPlayerOptions);
#endif
```
## Questions, Bugs, Feature requests
Please for use
- https://github.com/jelte/be.khepri.play.assetdelivery.addressables/discussions for any questions and feature requests
- https://github.com/jelte/be.khepri.play.assetdelivery.addressables/issues for bugs
没有合适的资源?快使用搜索试试~ 我知道了~
PadDemo_Unity.zip
共1226个文件
meta:629个
cs:437个
md:52个
需积分: 1 63 下载量 71 浏览量
2021-09-17
10:35:07
上传
评论
收藏 25.96MB ZIP 举报
温馨提示
谷歌2021.8.1开始强制使用PAD分发,该资源为谷歌PAD(Play Asset Delivery)的Unity示例工程,使用Addressables+PAD进行分发GooglePlay应用。请结合文章配合使用:https://blog.csdn.net/egostudio/article/details/118360117
资源推荐
资源详情
资源评论
收起资源包目录
PadDemo_Unity.zip (1226个子文件)
playcore.aar 202KB
Unity.Addressables.Editor.Tests.asmdef 793B
Unity.Addressables.Samples.Tests.asmdef 667B
Unity.Addressables.Editor.asmdef 559B
Unity.Addressables.Runtime.Tests.asmdef 545B
Unity.Addressables.SamplesFolder.asmdef 486B
Khepri.AssetDelivery.asmdef 441B
Unity.ResourceManager.Tests.asmdef 430B
Khepri.AssetDelivery.Editor.asmdef 424B
Unity.Addressables.asmdef 352B
Google.Play.AssetDelivery.asmdef 196B
Google.Play.Core.asmdef 125B
Google.Play.Common.asmdef 105B
Google.Android.AppBundle.Editor.asmdef 100B
Unity.ResourceManager.asmdef 43B
ProjectSettings.asset 19KB
InputManager.asset 6KB
QualitySettings.asset 5KB
AddressableAssetSettings.asset 3KB
GraphicsSettings.asset 2KB
Packed Assets.asset 2KB
Default Local Group_BundledAssetGroupSchema.asset 2KB
Packed Assets_BundledAssetGroupSchema.asset 1KB
Physics2DSettings.asset 1KB
NavMeshAreas.asset 1KB
Packed Assets.asset 1KB
DynamicsManager.asset 1KB
Built In Data.asset 929B
UnityConnectSettings.asset 853B
PresetManager.asset 824B
Default Local Group.asset 822B
BuildScriptPackedPlayMode.asset 816B
BuildScriptVirtualMode.asset 813B
BuildScriptPackedMode.asset 812B
BuildScriptFastMode.asset 810B
EditorSettings.asset 715B
Built In Data_PlayerDataGroupSchema.asset 568B
Default Local Group_ContentUpdateGroupSchema.asset 533B
Packed Assets_ContentUpdateGroupSchema.asset 527B
Packed Assets_AssetPackGroupSchema.asset 522B
DefaultObject.asset 469B
AssetPacks.asset 436B
TagManager.asset 435B
AudioManager.asset 377B
EditorBuildSettings.asset 361B
VFXManager.asset 273B
TimeManager.asset 195B
NetworkManager.asset 159B
ClusterInputManager.asset 120B
addressables_content_state.bin 1KB
AddressablesIntegrationTestsImpl.cs 121KB
AddressableAssetSettings.cs 98KB
Addressables.cs 78KB
AddressableAssetSettingsTests.cs 63KB
AddressableAssetsSettingsGroupTreeView.cs 62KB
ContentUpdateTests.cs 61KB
BuildScriptPackedMode.cs 58KB
BundledAssetGroupSchema.cs 54KB
AddressablesImpl.cs 52KB
ResourceManager.cs 50KB
AndroidSdkManager.cs 48KB
BuildScriptPackedTests.cs 47KB
AssetReferenceDrawer.cs 40KB
AddressableAssetEntry.cs 39KB
ContentUpdateScript.cs 39KB
AddressableAssetEntryTests.cs 39KB
AppBundleBuilder.cs 37KB
AddressableAssetSettingsInspector.cs 32KB
CommandLine.cs 32KB
AddressableAssetSettingsLocatorTests.cs 31KB
ProviderOperationTests.cs 30KB
AssetReference.cs 30KB
ProfileWindow.cs 26KB
AddressableAssetProfileSettings.cs 26KB
ContentCatalogData.cs 26KB
AddressableAssetGroup.cs 24KB
BuildScriptTests.cs 24KB
AssetBundleProvider.cs 24KB
ResourceManagerConfig.cs 23KB
AddressableAssetGroupTemplateInspector.cs 23KB
HostingServicesManagerTests.cs 23KB
SceneTests.cs 22KB
AsyncOperationBase.cs 22KB
ContentCatalogTests.cs 22KB
EventViewerWindow.cs 21KB
AddressableAssetsSettingsGroupEditor.cs 21KB
BundleRuleBase.cs 21KB
VirtualAssetBundle.cs 21KB
BuildScriptVirtualMode.cs 20KB
AsyncOperationHandle.cs 20KB
ContentCatalogProvider.cs 19KB
ContentCatalogProviderTests.cs 19KB
AssetReferenceDrawerUtilities.cs 18KB
AddressableAssetEntryTreeViewTests.cs 18KB
HostingServicesWindow.cs 18KB
HostingServicesManager.cs 18KB
HttpHostingService.cs 18KB
AssetDeliveryWindow.cs 17KB
AssetSettingsAnalyzeTreeView.cs 17KB
SyncAddressableTests.cs 17KB
共 1226 条
- 1
- 2
- 3
- 4
- 5
- 6
- 13
资源评论
鱼蛋-Felix
- 粉丝: 2693
- 资源: 7
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功