ScalingAnimation.ts 353 B

123456789101112131415
  1. import { _decorator, Component, Node } from 'cc';
  2. const { ccclass, property } = _decorator;
  3. @ccclass('ScalingAnimation')
  4. export class ScalingAnimation extends Component {
  5. start() {
  6. }
  7. update(deltaTime: number) {
  8. let scale = (Math.sin(Date.now() / 1000) * 0.5 + 0.5) * 0.5 + 1;
  9. this.node.setScale(scale,scale,1.0);
  10. }
  11. }