|
@@ -1,16 +1,74 @@
|
|
-import { _decorator, Component, Node } from 'cc';
|
|
|
|
|
|
+import { _decorator, Component, Node, Toggle } from 'cc';
|
|
import { uiManager } from '../../manager/uiManager';
|
|
import { uiManager } from '../../manager/uiManager';
|
|
import { base_ui } from '../../fw/base_ui';
|
|
import { base_ui } from '../../fw/base_ui';
|
|
const { ccclass, property } = _decorator;
|
|
const { ccclass, property } = _decorator;
|
|
|
|
|
|
@ccclass('setting')
|
|
@ccclass('setting')
|
|
export class setting extends base_ui {
|
|
export class setting extends base_ui {
|
|
- @property(Node) btn_close:Node = null
|
|
|
|
- protected start(): void {
|
|
|
|
|
|
+ @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 start(): void {
|
|
this.onButtonListen(this.btn_close,()=>{
|
|
this.onButtonListen(this.btn_close,()=>{
|
|
this.close()
|
|
this.close()
|
|
- })
|
|
|
|
- }
|
|
|
|
|
|
+ })
|
|
|
|
+ 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
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|