unity基础:旋转、向量的定义与应用

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

public class rotate01 : MonoBehaviour
{
    // Start is called before the first frame update
    void Start()
    {
        
    }

    // Update is called once per frame
    void Update()
    {
       // transform.Rotate(0, 20,0 );	//绕y轴每帧旋转20度
		this.gameObject.transform.Rotate(0,20,0);
		//this指当前这个类
		Vector3 a = new Vector3 (10, 0, 0);
		this.transform.Rotate (a);
    }
}

你可能感兴趣的:(unity,c#,游戏引擎)