|
|
@@ -15,14 +15,23 @@ export default class MoreGamePopNode extends cc.Component {
|
|
|
data = null
|
|
|
|
|
|
start() {
|
|
|
+ gData.moreGame.init_moreGameList = true;
|
|
|
+ }
|
|
|
|
|
|
+ update() {
|
|
|
+ if (gData.moreGame.init_moreGameList) {
|
|
|
+ this.init();
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
- init(data) {
|
|
|
- this.data = data
|
|
|
+ lateUpdate() {
|
|
|
+ gData.moreGame.init_moreGameList = false;
|
|
|
+ }
|
|
|
|
|
|
+ init() {
|
|
|
+ this.data = gData.moreGame.getRandomNormal();
|
|
|
if (this.data) {
|
|
|
- cc.loader.load(data.icon, (err, res) => {
|
|
|
+ cc.loader.load(this.data.icon, (err, res) => {
|
|
|
if (err) {
|
|
|
console.log('err:', err);
|
|
|
return;
|
|
|
@@ -31,7 +40,7 @@ export default class MoreGamePopNode extends cc.Component {
|
|
|
this.icon.spriteFrame = new cc.SpriteFrame(tex);
|
|
|
})
|
|
|
|
|
|
- this.labName.string = data.title
|
|
|
+ this.labName.string = this.data.title
|
|
|
}
|
|
|
}
|
|
|
|