1234567891011121314151617181920212223 |
- import { _decorator, Component, Node } from 'cc';
- const { ccclass, property } = _decorator;
- @ccclass('Rotation')
- export class Rotation extends Component {
- rotation:number=0;
- @property({type:Number})
- spin:number=360;
- start() {
- }
- update(deltaTime: number) {
- this.rotation += deltaTime * this.spin;
- this.node.angle=this.rotation;
- }
- }
|