1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
- import { _decorator, Component, Node, Toggle } from 'cc';
- import { uiManager } from '../../manager/uiManager';
- import { base_ui } from '../../fw/base_ui';
- const { ccclass, property } = _decorator;
- @ccclass('setting')
- export class setting extends base_ui {
- @property(Node) btn_close:Node = null
- @property(Node) yinyue_btn_on:Node = null;
- @property(Node) yinyue_btn_off:Node = null;
- @property(Node) shengyin_btn_on:Node = null;
- @property(Node) shengyin_btn_off:Node = null;
- @property(Node) zhendong_btn_on:Node = null;
- @property(Node) zhendong_btn_off:Node = null;
- protected init(): void {
- this.onButtonListen(this.yinyue_btn_on, ()=>{
- this.updateYinyueStatus(false)
- })
- this.onButtonListen(this.yinyue_btn_off, ()=>{
- this.updateYinyueStatus(true)
- })
- this.onButtonListen(this.shengyin_btn_on, ()=>{
- this.updateShengyinStatus(false)
- })
- this.onButtonListen(this.shengyin_btn_off, ()=>{
- this.updateShengyinStatus(true)
- })
- this.onButtonListen(this.zhendong_btn_on, ()=>{
- this.updateZhendongStatus(false)
- })
- this.onButtonListen(this.zhendong_btn_off, ()=>{
- this.updateZhendongStatus(true)
- })
- this.updateYinyueStatus(true)
- this.updateShengyinStatus(true)
- this.updateZhendongStatus(true)
- }
- updateYinyueStatus(open:boolean) {
- if(open) {
- this.yinyue_btn_on.active = true
- this.yinyue_btn_off.active = false
- } else {
- this.yinyue_btn_on.active = false
- this.yinyue_btn_off.active = true
- }
- }
- updateShengyinStatus(open:boolean) {
- if(open) {
- this.shengyin_btn_on.active = true
- this.shengyin_btn_off.active = false
- } else {
- this.shengyin_btn_on.active = false
- this.shengyin_btn_off.active = true
- }
- }
- updateZhendongStatus(open:boolean) {
- if(open) {
- this.zhendong_btn_on.active = true
- this.zhendong_btn_off.active = false
- } else {
- this.zhendong_btn_on.active = false
- this.zhendong_btn_off.active = true
- }
- }
- }
|