You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
395 B
23 lines
395 B
|
1 week ago
|
import { Component, _decorator, Node } from "cc";
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
const { ccclass, property } = _decorator;
|
||
|
|
|
||
|
|
@ccclass
|
||
|
|
export class ClickButton extends Component {
|
||
|
|
|
||
|
|
onEnable() {
|
||
|
|
this.node.on(Node.EventType.TOUCH_START, this.onclick, this);
|
||
|
|
}
|
||
|
|
|
||
|
|
onDisable() {
|
||
|
|
this.node.on(Node.EventType.TOUCH_START, this.onclick, this);
|
||
|
|
}
|
||
|
|
|
||
|
|
onclick() {
|
||
|
|
gg.audio.playClick();
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|