| 12345678910111213141516171819202122 |
- import { _decorator, Component, Node, Label } from 'cc';
- const { ccclass, property } = _decorator;
- @ccclass('HeroRewardGetItem')
- export class HeroRewardGetItem extends Component {
- @property({ type: Node, displayName: "类型_粮草", tooltip: "类型_粮草" }) nodeLc: Node = null;
- @property({ type: Node, displayName: "类型_红包币", tooltip: "类型_红包币" }) nodeBb: Node = null;
- @property({ type: Node, displayName: "广告icon", tooltip: "广告icon" }) nodeAd: Node = null;
- @property({ type: Label, displayName: "文本_数量", tooltip: "文本_数量" }) txtNum: Label = null;
- @property({ type: Label, displayName: "文本_名称", tooltip: "文本_名称" }) txtName: Label = null;
- public init(type: number, num: number, isAdReward: boolean) {
- this.nodeLc.active = type == 1;
- this.nodeBb.active = type == 3;
- this.nodeAd.active = type == 3;
- this.txtName.string = type == 1 ? "粮草" : "红包币";
- this.txtNum.string = num + "";
- this.nodeAd.active = isAdReward;
- }
- }
|