Auction.js 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. // Learn cc.Class:
  2. // - https://docs.cocos.com/creator/manual/en/scripting/class.html
  3. // Learn Attribute:
  4. // - https://docs.cocos.com/creator/manual/en/scripting/reference/attributes.html
  5. // Learn life-cycle callbacks:
  6. // - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html
  7. cc.Class({
  8. extends: cc.Component,
  9. properties: {
  10. giveUp: cc.Node,
  11. addPrice: cc.Node,
  12. dialog:cc.Node,
  13. text:cc.Label,
  14. time:cc.Node,
  15. countdown:0,
  16. },
  17. // LIFE-CYCLE CALLBACKS:
  18. // onLoad () {},
  19. start () {
  20. // this.text.string = "起拍价5W" // 场景文本框为 显示5
  21. // this.countdown = 0;
  22. // if (this.countdown >= 0) {
  23. // this.schedule(function () { // 计时器将每隔 1s 执行一次。
  24. // this.textChane();
  25. // this.text.string = '现在拍卖开始!';
  26. // if(this.countdown==2){
  27. // this.node.destroy();
  28. // this.dialog.active = true
  29. // }
  30. // }, 2);
  31. // }
  32. },
  33. textChane(){
  34. this.countdown = this.countdown + 1;
  35. }
  36. // update (dt) {},
  37. });