Commit f3bcc7bd authored by liujiaxin's avatar liujiaxin

feat: add native fn flag

parent 98a8eb7b
......@@ -581,80 +581,82 @@ cc.Class({
const gs = groundBg.getComponent(cc.Sprite);
gs.spriteFrame = sf;
groundBg.active = true;
});
let dbCount = 0;
let finishDbCount = 0
for(const block of this.data.hotZoneItemArr) {
if (block.gIdx == '0' || block.gIdx == '1') {
dbCount++;
let dbCount = 0;
let finishDbCount = 0
for(const block of this.data.hotZoneItemArr) {
if (block.gIdx == '0' || block.gIdx == '1') {
dbCount++;
}
}
}
for(const block of this.data.hotZoneItemArr) {
for(const block of this.data.hotZoneItemArr) {
if (block.gIdx == '2') {
const s1 = ((ground.width / block.imgSizeW) + (ground.height / block.imgSizeH)) / 2
const node = new cc.Node();
node.parent = ground;
const spr = node.addComponent(cc.Sprite);
getSpriteFrimeByUrl(block.pic_url, (sf) => {
spr.spriteFrame = sf;
node.scale = s1;
})
if (block.gIdx == '2') {
const s1 = ((ground.width / block.imgSizeW) + (ground.height / block.imgSizeH)) / 2
const node = new cc.Node();
node.parent = ground;
const spr = node.addComponent(cc.Sprite);
getSpriteFrimeByUrl(block.pic_url, (sf) => {
spr.spriteFrame = sf;
node.scale = s1;
})
}
if (block.gIdx == '0' || block.gIdx == '1') {
const n = new cc.Node();
n.scale = 0.25;
const db = n.addComponent(dragonBones.ArmatureDisplay);
n.parent = ground;
n.active = false;
loadDragonBones(db, {
tex: block.texPngData.url,
atlas: block.texJsonData.url,
ske: block.skeJsonData.url,
}).then(({width, height}) => {
n.width = width;
n.height = height;
n.active = true;
db.playAnimation('normal', 0);
finishDbCount++;
console.log(finishDbCount, dbCount)
if (finishDbCount == dbCount) {
this.loadEnd();
}
}).catch(() => {
finishDbCount++;
console.log(finishDbCount, dbCount)
if (finishDbCount == dbCount) {
this.loadEnd();
}
});
if (block.gIdx == '0') {
const rectInfo = {
node: n,
audio_url: block.audio_url ,
rect: {
x: block.rect.x / baseRect.width,
y: block.rect.y / baseRect.height,
width: block.rect.width / baseRect.width,
height: block.rect.height / baseRect.height,
}
if (block.gIdx == '0' || block.gIdx == '1') {
const n = new cc.Node();
n.scale = 0.25;
const db = n.addComponent(dragonBones.ArmatureDisplay);
n.parent = ground;
n.active = false;
loadDragonBones(db, {
tex: block.texPngData.url,
atlas: block.texJsonData.url,
ske: block.skeJsonData.url,
}).then(({width, height}) => {
n.width = width;
n.height = height;
n.active = true;
db.playAnimation('normal', 0);
finishDbCount++;
console.log(finishDbCount, dbCount)
if (finishDbCount == dbCount) {
this.loadEnd();
}
};
this._figurePointRectArray.push(rectInfo);
if (block.labelText) {
const k = +block.labelText * 1000;
if(!isNaN(k)) {
this._hintsNodeList.push({
node: n,
after: k
});
}).catch(() => {
finishDbCount++;
console.log(finishDbCount, dbCount)
if (finishDbCount == dbCount) {
this.loadEnd();
}
});
if (block.gIdx == '0') {
const rectInfo = {
node: n,
audio_url: block.audio_url ,
rect: {
x: block.rect.x / baseRect.width,
y: block.rect.y / baseRect.height,
width: block.rect.width / baseRect.width,
height: block.rect.height / baseRect.height,
}
};
this._figurePointRectArray.push(rectInfo);
if (block.labelText) {
const k = +block.labelText * 1000;
if(!isNaN(k)) {
this._hintsNodeList.push({
node: n,
after: k
});
}
}
}
}
}
}
});
// console.log(this.data);
console.log('resource perload finish');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment