uv1.ts 334 B

123456789101112131415161718
  1. const { ccclass, property } = cc._decorator;
  2. @ccclass
  3. export default class spritearrow extends cc.Component {
  4. time = 0
  5. _material
  6. start() {
  7. this.time = 0;
  8. this._material = this.getComponent(cc.Sprite).getMaterial(0);
  9. }
  10. update() {
  11. this.time += 0.0031;
  12. this._material.setProperty('time', this.time);
  13. }
  14. }