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

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

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