GithubHelp home page GithubHelp logo

danyow / be.khepri.play.assetdelivery.addressables.cn Goto Github PK

View Code? Open in Web Editor NEW

This project forked from thanh-nguyen-kim/be.khepri.play.assetdelivery.addressables

1.0 0.0 0.0 100 KB

Android Play Asset Delivery support for Unity Addressables

License: MIT License

C# 100.00%

be.khepri.play.assetdelivery.addressables.cn's Introduction

Play Asset Delivery - Addressables

openupm

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 import the lastest Google Play Plugins for Unity at https://github.com/google/play-unity-plugins/releases. We only need to import the following package:

  • com.google.play.common
  • com.google.play.core
  • com.google.android.appbundle
  • com.google.play.assetdelivery

Next you can add the package to your project via the Package Manager or by manually editing the manifest.json

Via Package Manager

  1. Press +
  2. Select Add package from git URL...
  3. url: https://github.com/thanh-nguyen-kim/be.khepri.play.assetdelivery.addressables.git

Via manifest.json

   "https://github.com/thanh-nguyen-kim/be.khepri.play.assetdelivery.addressables.git",

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...

be.khepri.play.assetdelivery.addressables.cn's People

Contributors

danyow avatar jelte avatar thanh-nguyen-kim avatar

Stargazers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.