import { _decorator, Component, Node, Toggle } from 'cc'; const { ccclass, property } = _decorator; @ccclass('attributes_show') export class attributes_show extends Component { @property(Node) check_select:Node = null; private call_back = null; private isCheckShow = false; public initView(call){ this.call_back = call; this.check_select.on("toggle",()=>{ this.isCheckShow=this.check_select.getComponent(Toggle).isChecked; this.change() }) } change(){ if(this.call_back!=null){ this.call_back(this.isCheckShow) } } public update_att(is_check:boolean){ this.isCheckShow = is_check; this.check_select.getComponent(Toggle).isChecked = this.isCheckShow; } }