Commit f3bcc7bd authored by liujiaxin's avatar liujiaxin

feat: add native fn flag

parent 98a8eb7b
...@@ -581,80 +581,82 @@ cc.Class({ ...@@ -581,80 +581,82 @@ cc.Class({
const gs = groundBg.getComponent(cc.Sprite); const gs = groundBg.getComponent(cc.Sprite);
gs.spriteFrame = sf; gs.spriteFrame = sf;
groundBg.active = true; groundBg.active = true;
});
let dbCount = 0; let dbCount = 0;
let finishDbCount = 0 let finishDbCount = 0
for(const block of this.data.hotZoneItemArr) { for(const block of this.data.hotZoneItemArr) {
if (block.gIdx == '0' || block.gIdx == '1') { if (block.gIdx == '0' || block.gIdx == '1') {
dbCount++; dbCount++;
}
} }
} for(const block of this.data.hotZoneItemArr) {
for(const block of this.data.hotZoneItemArr) {
if (block.gIdx == '2') { if (block.gIdx == '2') {
const s1 = ((ground.width / block.imgSizeW) + (ground.height / block.imgSizeH)) / 2 const s1 = ((ground.width / block.imgSizeW) + (ground.height / block.imgSizeH)) / 2
const node = new cc.Node(); const node = new cc.Node();
node.parent = ground; node.parent = ground;
const spr = node.addComponent(cc.Sprite); const spr = node.addComponent(cc.Sprite);
getSpriteFrimeByUrl(block.pic_url, (sf) => { getSpriteFrimeByUrl(block.pic_url, (sf) => {
spr.spriteFrame = sf; spr.spriteFrame = sf;
node.scale = s1; node.scale = s1;
}) })
} }
if (block.gIdx == '0' || block.gIdx == '1') { if (block.gIdx == '0' || block.gIdx == '1') {
const n = new cc.Node(); const n = new cc.Node();
n.scale = 0.25; n.scale = 0.25;
const db = n.addComponent(dragonBones.ArmatureDisplay); const db = n.addComponent(dragonBones.ArmatureDisplay);
n.parent = ground; n.parent = ground;
n.active = false; n.active = false;
loadDragonBones(db, { loadDragonBones(db, {
tex: block.texPngData.url, tex: block.texPngData.url,
atlas: block.texJsonData.url, atlas: block.texJsonData.url,
ske: block.skeJsonData.url, ske: block.skeJsonData.url,
}).then(({width, height}) => { }).then(({width, height}) => {
n.width = width; n.width = width;
n.height = height; n.height = height;
n.active = true; n.active = true;
db.playAnimation('normal', 0); db.playAnimation('normal', 0);
finishDbCount++; finishDbCount++;
console.log(finishDbCount, dbCount) console.log(finishDbCount, dbCount)
if (finishDbCount == dbCount) { if (finishDbCount == dbCount) {
this.loadEnd(); 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,
} }
}; }).catch(() => {
this._figurePointRectArray.push(rectInfo); finishDbCount++;
console.log(finishDbCount, dbCount)
if (block.labelText) { if (finishDbCount == dbCount) {
const k = +block.labelText * 1000; this.loadEnd();
if(!isNaN(k)) { }
this._hintsNodeList.push({ });
node: n, if (block.gIdx == '0') {
after: k 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(this.data);
console.log('resource perload finish'); 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