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.
38 lines
1.2 KiB
38 lines
1.2 KiB
import { _decorator, Component, Node, find } from 'cc';
|
|
import { UIID } from '../../game/ConfigRes';
|
|
const { ccclass, property } = _decorator;
|
|
|
|
@ccclass('topNode')
|
|
export class topNode extends Component {
|
|
private btnFeedback: Node = null;
|
|
private btnAddDesk: Node = null;
|
|
|
|
onLoad() {
|
|
this.btnFeedback = find('btnFeedback', this.node) || this.node.getChildByName('btnFeedback');
|
|
this.btnAddDesk = find('btnAddDesk', this.node) || this.node.getChildByName('btnAddDesk');
|
|
}
|
|
|
|
onEnable() {
|
|
this.btnFeedback?.on(Node.EventType.TOUCH_END, this.click_btnFeedback, this);
|
|
this.btnAddDesk?.on(Node.EventType.TOUCH_END, this.click_btnAddDesk, this);
|
|
}
|
|
|
|
onDisable() {
|
|
this.btnFeedback?.off(Node.EventType.TOUCH_END, this.click_btnFeedback, this);
|
|
this.btnAddDesk?.off(Node.EventType.TOUCH_END, this.click_btnAddDesk, this);
|
|
}
|
|
|
|
click_btnFeedback() {
|
|
gg.ui.openPanel(UIID.Complain);
|
|
}
|
|
|
|
click_btnAddDesk() {
|
|
gg.sdk.addShortcut((res) => {
|
|
if (res) {
|
|
gg.ui.showToast('添加成功');
|
|
} else {
|
|
gg.ui.showToast('添加失败');
|
|
}
|
|
});
|
|
}
|
|
}
|
|
|