中文 | English

RocketDriver Pro

Logo

RocketDriver Pro is a game framework for Unity engine


2. Loading management module (Loader) - supports free switching of three modes: Resources, Editor, Assetbundle

2.1 Initialization

2.1.1 Generate configuration assets

Execute menu “Tools -> RocketDriver -> Project -> Gen LoaderSettings”.
The LoaderSettings.asset (renameable) file will be generated under the project Assets/Resources.
image
image

2.1.2 Set configuration according to project requirements

There are 5 available configurations in LoaderSettings, one Editor mode, two Resource modes, and two AssetBundle modes.

2.1.3 Initializing Loaders with Configuration

Initialize the loader with the following API:

2.1.4 Initialize Bundle version information

Call the function in the loader instance:
image

2.2 Use

2.2.1 Load Bundle assets

Bundle assets can be loaded only after the Bundle version information is initialized.
The loader implements the IBundleLoader interface and contains functions related to loading Bundle assets.
Loading Bundle assets requires the use of coroutines, which can be enabled using a LoaderManager.Mono instance to load Bundles by coroutines. image

2.2.2 Loading resource assets

In the case of obtaining the bundle instance, the instance of the resource asset can be instantiated from the bundle instance, and then cloned and used.
It is recommended to use synchronous functions for loading resource assets, and asynchronous functions are not recommended. The reason is that Unity does not support opening coroutines within coroutines friendly, and if there are too many layers (like 16 layers), unpredictable errors will appear.

The IAssetLoader interface functions are divided into four categories:

2.3 Example

JLGames/RocketDriver/Samples/Loader
image