Commit 7d4dca63 authored by 李维's avatar 李维

修复按钮动画一开始时就出现的问题

parent d0cf5b13
...@@ -28157,8 +28157,8 @@ ...@@ -28157,8 +28157,8 @@
0, 0,
0, 0,
1, 1,
0.65, 0,
0.65, 0,
0 0
] ]
}, },
...@@ -28336,8 +28336,8 @@ ...@@ -28336,8 +28336,8 @@
0, 0,
0, 0,
1, 1,
0.65, 0,
0.65, 0,
0 0
] ]
}, },
...@@ -28515,8 +28515,8 @@ ...@@ -28515,8 +28515,8 @@
0, 0,
0, 0,
1, 1,
0.5, 0,
0.5, 0,
1 1
] ]
}, },
......
import { initAir } from "./air"; import { initAir } from "./air";
import { middleLayerBase } from "./middleLayerBase"; import { middleLayerBase } from "./middleLayerBase";
import { buttonOnceClick, buttonOnClick, guid } from "./util"; import { asyncDelay, buttonOnceClick, buttonOnClick, guid } from "./util";
const { ccclass, property } = cc._decorator; const { ccclass, property } = cc._decorator;
...@@ -786,36 +786,39 @@ export default class NewClass extends middleLayerBase { ...@@ -786,36 +786,39 @@ export default class NewClass extends middleLayerBase {
const btn_replay = cc.find("middleLayer/finishLayer/btn_replay"); const btn_replay = cc.find("middleLayer/finishLayer/btn_replay");
const btn_ok = cc.find("middleLayer/finishLayer/btn_ok"); const btn_ok = cc.find("middleLayer/finishLayer/btn_ok");
return new Promise(resolve => { return new Promise(async resolve => {
if(type == 0) { if(type == 0) {
// 单课件完成 // 单课件完成
btn_next.scale = 0; btn_next.scale = 0;
btn_replay.scale = 0; btn_replay.scale = 0;
finishLayer.active = true;
finishLayer.active = true
aniOne.active = true; aniOne.active = true;
aniAll.active = false; aniAll.active = false;
btn_next.active = true; btn_next.active = true;
btn_replay.active = true; btn_replay.active = true;
btn_ok.active = false; btn_ok.active = false;
aniOne.getComponent(dragonBones.ArmatureDisplay).playAnimation('newAnimation', 1); aniOne.getComponent(dragonBones.ArmatureDisplay).playAnimation('newAnimation', 1);
const targetScale = 0.65; const targetScale = 0.65;
await asyncDelay(0.6);
cc.tween(btn_next) cc.tween(btn_next)
.delay(0.6) .set({ scale: 0 })
.to(0.35, { scale: targetScale }) .to(0.35, { scale: targetScale })
.start(); .start();
cc.tween(btn_replay) cc.tween(btn_replay)
.delay(0.6) .set({ scale: 0 })
.to(0.35, { scale: targetScale }) .to(0.35, { scale: targetScale })
.call(() => { .call(() => {
resolve(true); resolve(true);
}) })
.start(); .start();
} else if (type == 1) { } else if (type == 1) {
// 一课全部完成 // 一课全部完成
btn_ok.scale = 0;
finishLayer.active = true; finishLayer.active = true;
aniOne.active = false; aniOne.active = false;
aniAll.active = true; aniAll.active = true;
...@@ -823,16 +826,19 @@ export default class NewClass extends middleLayerBase { ...@@ -823,16 +826,19 @@ export default class NewClass extends middleLayerBase {
btn_replay.active = false; btn_replay.active = false;
btn_ok.active = false; btn_ok.active = false;
aniAll.getComponent(dragonBones.ArmatureDisplay).playAnimation('newAnimation', 1); aniAll.getComponent(dragonBones.ArmatureDisplay).playAnimation('newAnimation', 1);
// const targetScale = 0.65; // const targetScale = 0.5;
cc.tween(btn_ok) cc.tween(btn_ok)
.delay(1.8) .delay(2.5)
.call(() => { .call(() => {
resolve(true);
this.playFinishLayerAnim(-1); this.playFinishLayerAnim(-1);
resolve(true);
}) })
.start(); .start();
} else { } else {
// 隐藏全部 // 隐藏全部
btn_next.scale = 0;
btn_replay.scale = 0;
btn_ok.scale = 0;
finishLayer.active = false; finishLayer.active = false;
aniOne.active = false; aniOne.active = false;
aniAll.active = false; aniAll.active = false;
......
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