Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
loadNoticePic() {
const self = this;
const bgSprite = self.loadingBg.getComponent(cc.Sprite);
if (Gdt.loopBg) {
cc.loader.load(Gdt.loopBg, (err, texture) => {
if (!err) bgSprite.spriteFrame = new cc.SpriteFrame(texture);
Utils.GD.showWxLoading(false);
});
return;
};
Utils.GD.getAircaftWarBg((res) => {
Utils.GD.showWxLoading(false);
if (res) {
cc.loader.load(res.fileList[0].tempFileURL, (err, texture) => {
if (!err) {
Gdt.loopBg = texture;
bgSprite.spriteFrame = new cc.SpriteFrame(texture);
}
})
}
loadNoticePic() {
const self = this;
const bgSprite = self.loadingBg.getComponent(cc.Sprite);
if (Gdt.loopBg) {
cc.loader.load(Gdt.loopBg, (err, texture) => {
if (!err) bgSprite.spriteFrame = new cc.SpriteFrame(texture);
Utils.GD.showWxLoading(false);
});
return;
};
Utils.GD.getAircaftWarBg((res) => {
Utils.GD.showWxLoading(false);
if (res) {
cc.loader.load(res.fileList[0].tempFileURL, (err, texture) => {
if (!err) {
Gdt.loopBg = texture;
bgSprite.spriteFrame = new cc.SpriteFrame(texture);
}
})
}
})
start() {
this.loopBg1.y = 0;
this.loopBg2.y = this.node.parent.height;
if (Gdt.loopBg) {
this.loopBg1.getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(Gdt.loopBg);
this.loopBg2.getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(Gdt.loopBg)
}
},
bgMove(dt) {
start() {
this.loopBg1.y = 0;
this.loopBg2.y = this.node.parent.height;
if (Gdt.loopBg) {
this.loopBg1.getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(Gdt.loopBg);
this.loopBg2.getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(Gdt.loopBg)
}
},
bgMove(dt) {