
cc.Class({
    extends: cc.Component,

    properties: {
    
    },


    onLoad () {
    },
    
    onEnable(){
        let interval = cc.HQ.Global.random1(2, 6);   // 以秒为单位的时间间隔
        let repeat = 9999999; // 重复次数
        let delay = cc.HQ.Global.random1(0, 1); // 开始延时

        this.unscheduleAllCallbacks();
        this.node.stopAllActions();

        this.schedule(function() {
            
            let rotationDir = cc.HQ.Global.random2([-1, 1], [1, 1]);    //随机方向
            let rotationT = 2;  //旋转总耗时
            let rotationQ = 1;  //圈数

            this.node.stopAllActions();
            let action1 = cc.rotateBy(rotationT, (rotationQ * 360 * rotationDir)).easing(cc.easeIn(1.0));;
            this.node.runAction(action1);
            
        }, interval, repeat, delay);
        
    },

    start () {

    },

    // update (dt) {},
});
