TS 一直旋转脚本

const {ccclass, property} = cc._decorator;

@ccclass

export default class RotateForever extends cc.Component {

    @property({type: cc.Integer, displayName:"速度1圈多少秒"})

    time : number  = 20;

    onLoad () {

        cc.tween(this.node)

        .repeatForever(

            cc.tween(this.node)

            .by(this.time, {angle : -360})

            .start()

        )

        .start()

    }

}

猜你喜欢

转载自blog.csdn.net/qq_17148595/article/details/115002823
ts