CardUplevelItem.ts 587 B

123456789101112131415161718192021222324252627
  1. /**
  2. * 升级节点记录
  3. */
  4. const {ccclass, property} = cc._decorator;
  5. @ccclass
  6. export default class CardUplevelItem extends cc.Component {
  7. @property(cc.Label)
  8. mLabel: cc.Label = null;//数值显示
  9. @property(cc.ProgressBar)
  10. mProgessBar: cc.ProgressBar = null;
  11. public setLabel(v1,v2){
  12. this.mProgessBar.node.active = true
  13. if(this.mLabel){
  14. this.mLabel.string = v1+'/'+v2
  15. }
  16. this.mProgessBar.progress = v1/v2
  17. }
  18. public setLock(){
  19. this.mProgessBar.node.active = false
  20. }
  21. }