[]Laya.loader.create 加载进度问题
我用Laya.loader.create加载.lh模型,
function ModelManager() {
Laya.loader.create("res/Pipe/Pipe/a.lh", Laya.Handler.create(this, this.onCreateComplete()),Laya.Handler.create(this, this.onAssetsLoading));
}
ModelManager.prototype.onCreateComplete = function () {
console.log("onCreateComplete");
var pipe = Laya.loader.getRes("res/Pipe/Pipe/a.lh");
console.log("pipe", pipe);
}
ModelManager.prototype.onAssetsLoading = function (progress) {
console.log("progress = ",progress);
}
打印出来的信息是
onCreateComplete
pipe undefined
progress = 1
progress = 0.3333333333333333
progress = 1
为什么加载完成后又重新计算进度,而且在加载完成的回调方法里还获取不到加载了的资源
function ModelManager() {
Laya.loader.create("res/Pipe/Pipe/a.lh", Laya.Handler.create(this, this.onCreateComplete()),Laya.Handler.create(this, this.onAssetsLoading));
}
ModelManager.prototype.onCreateComplete = function () {
console.log("onCreateComplete");
var pipe = Laya.loader.getRes("res/Pipe/Pipe/a.lh");
console.log("pipe", pipe);
}
ModelManager.prototype.onAssetsLoading = function (progress) {
console.log("progress = ",progress);
}
打印出来的信息是
onCreateComplete
pipe undefined
progress = 1
progress = 0.3333333333333333
progress = 1
为什么加载完成后又重新计算进度,而且在加载完成的回调方法里还获取不到加载了的资源
没有找到相关结果
已邀请:
要回复问题请先登录
2 个回复
豪
赞同来自:
this.onCreateComplete() 应该改为 this.onCreateComplete
见笑了。。
1573629845用户
赞同来自: