| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- cc.Class({
- extends: cc.Component,
- properties: {
- _isOpen: true,
- },
- // LIFE-CYCLE CALLBACKS:
- // onLoad () {},
- start() {
- },
- onEnable() {
- this.qiyong = this.node.getChildByName("启用");
- this.buqiyong = this.node.getChildByName("不启用");
- if (OnOff == true) {
- this.qiyong.active = true;
- this.buqiyong.active = false;
- this._isOpen = true;
- } else {
- this.qiyong.active = false;
- this.buqiyong.active = true;
- this._isOpen = false;
- }
- },
- 启用(event) {
- event.target.active = false;
- this._isOpen = false;
- this.buqiyong.active = true;
- },
- 不启用(event) {
- event.target.active = false;
- this._isOpen = true;
- this.qiyong.active = true;
- },
- 取消() {
- if (this._isOpen == true) {
- this.qiyong.active = true;
- this.buqiyong.active = false;
- } else {
- this.qiyong.active = false;
- this.buqiyong.active = true;
- }
- this.关闭();
- },
- 保存() {
- OnOff = this._isOpen;
- this.关闭();
- },
- 关闭() {
- this.node.active = false;
- cc.director.resume();
- },
- // update (dt) {},
- });
|