大侠
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

28 lines
729 B

import { _decorator, CCBoolean, Label, Node } from "cc";
import redtype from "./redtype";
import { redinfo } from "./RedPointLogic";
const { ccclass, property, menu } = _decorator;
@ccclass
@menu("红点/红点显示控制")
export default class redCom extends redtype {
@property
isShowLabel:boolean = true;
@property(Node)
red:Node = null;
@property(Node)
label:Node = null;
receive(tRedinfo: redinfo) {
if( this.red){
CNodeUtils.setActive(this.red,tRedinfo.show);
}
if (this.label) {
CNodeUtils.setActive(this.label,tRedinfo.show && this.isShowLabel);
this.label.getComponent(Label).string = `${tRedinfo.count}`
}
}
}