Commit 4cd1b5ee authored by Vũ Gia Vương's avatar Vũ Gia Vương

add sound

parent 5ed973cb
import { eventTarget, CHECK_TOUCH, CHECK_FRAGMENT, HAMMER, RESET_FRAGMENT } from "../Events"; import { eventTarget, CHECK_TOUCH, CHECK_FRAGMENT, HAMMER, RESET_FRAGMENT, PLAY_DROP_SOUND } from "../Events";
const { ccclass, property } = cc._decorator; const { ccclass, property } = cc._decorator;
...@@ -45,6 +45,9 @@ export default class FragmentController extends cc.Component { ...@@ -45,6 +45,9 @@ export default class FragmentController extends cc.Component {
this.node.setSiblingIndex(-1); this.node.setSiblingIndex(-1);
cc.tween(this.node) cc.tween(this.node)
.delay(0.5) .delay(0.5)
.call(() => {
eventTarget.emit(PLAY_DROP_SOUND);
})
.to(0.2, { scale: 0.95 }) .to(0.2, { scale: 0.95 })
.to(0.2, { scale: 1.05, position: pos.clone().multiplyScalar(1.2) }) .to(0.2, { scale: 1.05, position: pos.clone().multiplyScalar(1.2) })
.call(() => { .call(() => {
......
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