chess_setting_view.ts 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. import { _decorator, Component, Node, Toggle } from 'cc';
  2. import GBaseUI from '../gcommon/GBaseUI';
  3. import { UIButton } from '../gcommon/UIButton';
  4. import { page_btn } from './page_btn';
  5. const { ccclass, property } = _decorator;
  6. @ccclass('chess_setting_view')
  7. export class chess_setting_view extends GBaseUI {
  8. @property(Node)
  9. btn_close: Node = null;
  10. @property(Node)
  11. btn_bg_music: Node = null;
  12. @property(Node)
  13. btn_chess_music: Node = null;
  14. @property(Node)
  15. btn_recv_msg: Node = null;
  16. @property(Node)
  17. btn_show_tips: Node = null;
  18. @property(Node)
  19. btn_show_chess_ani: Node = null;
  20. start() {
  21. UIButton.BindClick(this.btn_close,()=>{
  22. this.closeUI()
  23. },this)
  24. UIButton.BindClick(this.btn_bg_music,()=>{
  25. this.clickToggle(this.btn_bg_music)
  26. },this)
  27. UIButton.BindClick(this.btn_chess_music,()=>{
  28. this.clickToggle(this.btn_chess_music)
  29. },this)
  30. UIButton.BindClick(this.btn_recv_msg,()=>{
  31. this.clickToggle(this.btn_recv_msg)
  32. },this)
  33. UIButton.BindClick(this.btn_show_tips,()=>{
  34. this.clickToggle(this.btn_show_tips)
  35. },this)
  36. UIButton.BindClick(this.btn_show_chess_ani,()=>{
  37. this.clickToggle(this.btn_show_chess_ani)
  38. },this)
  39. }
  40. clickToggle(node:Node){
  41. if(node.getComponent(page_btn).isSelect()){
  42. node.getComponent(page_btn).status_unselect()
  43. }else{
  44. node.getComponent(page_btn).status_select()
  45. }
  46. }
  47. update(deltaTime: number) {
  48. }
  49. }