请问这个代码用creator如何实现

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class LiTiBoard : MonoBehaviour {

	// Use this for initialization
	void Start () {
        //iTween.RotateBy(gameObject, iTween.Hash("x",.25, "delay",.4, "EaseType", "linear", "loopType", "none"));
	}
	
	// Update is called once per frame
	void Update () {
        transform.Rotate(new Vector3(0, 0, -30.0f * Time.deltaTime));// = Quaternion.Euler(new Vector3(0,3.0f*Time.deltaTime,0));
	}
}

creator版本:2.4.9

cc.Class({
    extends: cc.Component,
    onLoad() {
    },
    update() {
        let axis = cc.v3(0, 0, -1); //旋转轴,根据相似三角形求出
        let rad = 0.05; //旋转角度
        let quat_cur = this.node.quat; //当前的四元数
        this.__temp_quat = new cc.Quat();
        cc.Quat.rotateAroundLocal(this.__temp_quat, quat_cur, axis.normalize(), rad); //当面的四元数绕旋转轴旋转
        // 旋转后的结果 / 当前的四元数 / 旋转轴 / 旋转四元数
        this.node.quat = this.__temp_quat;
    },
});

解决了

1赞