Commit 8a3b8481 authored by 范雪寒's avatar 范雪寒

feat: buttonOnClick

parent 117bcd50
......@@ -504,15 +504,15 @@ export function jumpToCourseWare(courseWareId: number) {
}
}
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();
......
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