music_setting_view.ts 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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('music_setting_view')
  7. export class music_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. start() {
  15. UIButton.BindClick(this.btn_close,()=>{
  16. this.closeUI()
  17. },this)
  18. UIButton.BindClick(this.btn_bg_music,()=>{
  19. this.clickToggle(this.btn_bg_music)
  20. },this)
  21. UIButton.BindClick(this.btn_chess_music,()=>{
  22. this.clickToggle(this.btn_chess_music)
  23. },this)
  24. }
  25. clickToggle(node:Node){
  26. if(node.getComponent(page_btn).isSelect()){
  27. node.getComponent(page_btn).status_unselect()
  28. }else{
  29. node.getComponent(page_btn).status_select()
  30. }
  31. }
  32. update(deltaTime: number) {
  33. }
  34. }