fnt_count.ts 645 B

123456789101112131415161718192021222324252627282930313233
  1. import { _decorator, Component, Node, Label, tween, Vec3 } from 'cc';
  2. const { ccclass, property } = _decorator;
  3. @ccclass('fnt_count')
  4. export class fnt_count extends Component {
  5. _num:number = 0;
  6. start() {
  7. }
  8. show(num:number){
  9. if(num<0||this._num===num){
  10. }else{
  11. this.node.getComponent(Label).string = num.toString()
  12. this._num = num;
  13. this.node.scale = new Vec3(1.5, 1.5, 1)
  14. tween()
  15. .target(this.node)
  16. .to(0.5,{ scale: new Vec3(1, 1, 1) })
  17. .start();
  18. }
  19. }
  20. update(deltaTime: number) {
  21. }
  22. }