Commit 3eae6e8e authored by 范雪寒's avatar 范雪寒

feat: buttonOnClick

parent 88812c6d
......@@ -423,15 +423,15 @@ export function onHomeworkFinish() {
}
}
export function buttonOnClick(button: cc.Node, callback: Function, scale = 1.1) {
export function buttonOnClick(button: cc.Node, callback: Function, scale = 1.0) {
button.on('click', () => {
if (button['cantClick']) {
return;
}
button['cantClick'] = true;
cc.tween(button)
.to(0.1, { scale: scale * 1.1 })
.to(0.1, { scale: scale })
.to(0.1, { scale: 1.0 })
.call(() => {
button['cantClick'] = false;
callback && callback();
......@@ -440,6 +440,7 @@ export function buttonOnClick(button: cc.Node, callback: Function, scale = 1.1)
});
}
export function jumpToBundle(bundleName: string) {
const middleLayer = cc.find('middleLayer');
if (middleLayer) {
......
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