BonusLogItem.ts 1018 B

123456789101112131415161718192021222324252627282930
  1. import { _decorator, Component, Node, Label } from 'cc';
  2. const { ccclass, property } = _decorator;
  3. @ccclass('BonusLogItem')
  4. export class BonusLogItem extends Component {
  5. @property({ type: Label, tooltip: "玩家名字" })
  6. nameLabel: Label;
  7. @property({ type: Label, tooltip: "时间" })
  8. timeLabel: Label;
  9. start() {
  10. }
  11. public setData(data: { name: string, time: string }) {
  12. this.nameLabel.string = data.name;
  13. this.timeLabel.string = data.time;
  14. }
  15. }
  16. /**
  17. * [1] Class member could be defined like this.
  18. * [2] Use `property` decorator if your want the member to be serializable.
  19. * [3] Your initialization goes here.
  20. * [4] Your update function goes here.
  21. *
  22. * Learn more about scripting: https://docs.cocos.com/creator/3.0/manual/en/scripting/
  23. * Learn more about CCClass: https://docs.cocos.com/creator/3.0/manual/en/scripting/ccclass.html
  24. * Learn more about life-cycle callbacks: https://docs.cocos.com/creator/3.0/manual/en/scripting/life-cycle-callbacks.html
  25. */