层使用异步加载

This commit is contained in:
Harvey Zack committed 2019-04-29 08:21:19 +08:00
1 parent 8ee7488bb1
commit bf1a4f2234
4 files changed
+22 -11

No files matched your search

+4 -2
View File
@@ -6,8 +6,10 @@ export default class Layers {
this.id = 0;
this.art = art;
this.add = this.add.bind(this);
this.art.option.layers.forEach(item => {
this.add(item);
this.art.on('firstCanplay', () => {
this.art.option.layers.forEach(item => {
this.add(item);
});
});
}