import { _decorator, Component, Node, Toggle } from 'cc'; import GBaseUI from '../gcommon/GBaseUI'; import { UIButton } from '../gcommon/UIButton'; import { page_btn } from './page_btn'; const { ccclass, property } = _decorator; @ccclass('chess_setting_view') export class chess_setting_view extends GBaseUI { @property(Node) btn_close: Node = null; @property(Node) btn_bg_music: Node = null; @property(Node) btn_chess_music: Node = null; @property(Node) btn_recv_msg: Node = null; @property(Node) btn_show_tips: Node = null; @property(Node) btn_show_chess_ani: Node = null; start() { UIButton.BindClick(this.btn_close,()=>{ this.closeUI() },this) UIButton.BindClick(this.btn_bg_music,()=>{ this.clickToggle(this.btn_bg_music) },this) UIButton.BindClick(this.btn_chess_music,()=>{ this.clickToggle(this.btn_chess_music) },this) UIButton.BindClick(this.btn_recv_msg,()=>{ this.clickToggle(this.btn_recv_msg) },this) UIButton.BindClick(this.btn_show_tips,()=>{ this.clickToggle(this.btn_show_tips) },this) UIButton.BindClick(this.btn_show_chess_ani,()=>{ this.clickToggle(this.btn_show_chess_ani) },this) } clickToggle(node:Node){ if(node.getComponent(page_btn).isSelect()){ node.getComponent(page_btn).status_unselect() }else{ node.getComponent(page_btn).status_select() } } update(deltaTime: number) { } }