1.0.20 • Published 4 years ago
@meta-adapter/asset-agent v1.0.20
@meta-adapter/asset-agent
多引擎模版脚本,需要配合 @meta-adapter/asset-agent-cli 使用
使用方式
Laya 引擎使用示例
// Main.ts 中使用
import AssetAgent from '@meta-adapter/asset-agent';
import LayaAirAdapter from '@meta-adapter/asset-agent/layaair';
// 下载 templateCfg/config.json 初始化模版信息
AssetAgent.init().then(() => {
// 开启 version.json 的话在其回调调用,没有则直接调用
LayaAirAdapter.updateResourceVersion(AssetAgent);
// 游戏资源加载逻辑
// ...
});
逻辑组件中使用
import AssetAgent from '@meta-adapter/asset-agent';
// 脚本引用资源
Laya.loader.create(AssetAgent.Assets.Loading.Audios.PIA, ...);
// 脚本引用配置
if (AssetAgent.Config.DIFFICULTY === 2) {
console.log('over');
}
1.0.20
4 years ago
1.0.19
4 years ago
1.0.18
4 years ago
1.0.17
4 years ago
1.0.12
4 years ago
1.0.11
4 years ago
1.0.9
4 years ago
1.0.8
4 years ago
1.0.7-alpha.1
4 years ago
1.0.7-alpha.0
4 years ago