BtnScale.ts 512 B

12345678910111213141516171819202122232425
  1. const {ccclass, property} = cc._decorator;
  2. /**
  3. * 提示手指缩放效果
  4. */
  5. @ccclass
  6. export default class BtnScale extends cc.Component {
  7. // LIFE-CYCLE CALLBACKS:
  8. // onLoad () {}
  9. @property
  10. maxScale:number = 1.2
  11. @property
  12. minScale:number = 1
  13. @property
  14. time:number = 0.5
  15. start () {
  16. this.node.runAction(cc.repeatForever(cc.sequence(cc.scaleTo(this.time,this.maxScale),cc.scaleTo(this.time,this.minScale))))
  17. }
  18. // update (dt) {}
  19. }