Commit 30c7c2bd authored by 范雪寒's avatar 范雪寒

feat: replay

parent 979205fe
This diff is collapsed.
......@@ -385,6 +385,8 @@ cc.Class({
showNextBtn() {
onHomeworkFinish();
this.showRestartBtn();
const btnNext = cc.find('Canvas/bg/btnNext');
btnNext.active = true;
},
......@@ -426,6 +428,39 @@ cc.Class({
},
showRestartBtn() {
const btn = cc.find('Canvas/bg/btnReplay');
btn.active = true;
btn.off('click');
btn.on('click', () => {
const middleLayer = cc.find('middleLayer');
if (middleLayer) {
middleLayer.getComponent('middleLayer').reloadBundle();
} else {
console.log('没有middleLayer');
}
});
const circle = cc.find('Canvas/bg/btnReplay/bg_circle');
cc.tween(circle)
.set({ scale: 0.8, opacity: 255 })
.to(2, { scale: 1.2, opacity: 0 })
.union()
.repeatForever()
.start();
},
hideRestartBtn() {
console.log('hideRestartBtn');
const btn = cc.find('Canvas/bg/btnReplay');
btn.active = false;
const circle = cc.find('Canvas/bg/btnReplay/bg_circle');
circle.stopAllActions();
circle.scale = 0.8;
circle.opacity = 255;
},
......
{
"ver": "2.3.5",
"uuid": "40a7f7d6-3f30-46c7-b9e4-1d5fcfc0c648",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 409,
"height": 409,
"platformSettings": {},
"subMetas": {
"bg_circle": {
"ver": "1.0.4",
"uuid": "75bb0910-bb15-4daf-9a6d-6873c400a148",
"rawTextureUuid": "40a7f7d6-3f30-46c7-b9e4-1d5fcfc0c648",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 409,
"height": 409,
"rawWidth": 409,
"rawHeight": 409,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "87cc865a-7ac0-44b4-8919-3b01f815748f",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 262,
"height": 268,
"platformSettings": {},
"subMetas": {
"btn_replay": {
"ver": "1.0.4",
"uuid": "c2f5963d-2ed1-4add-91b8-f3c4ff0d893e",
"rawTextureUuid": "87cc865a-7ac0-44b4-8919-3b01f815748f",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 262,
"height": 268,
"rawWidth": 262,
"rawHeight": 268,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
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