import { _decorator, Component, Node, Sprite, SpriteFrame } from 'cc'; const { ccclass, property } = _decorator; @ccclass('MainBtnPoxy') export class MainBtnPoxy extends Component { @property(Node) protected Target:Node = null; @property(SpriteFrame) protected show: SpriteFrame = null; @property(SpriteFrame) protected hide: SpriteFrame = null; select(isOk: boolean) { this.Target.getComponent(Sprite).spriteFrame = isOk?this.show:this.hide; } }