using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Rotate : MonoBehaviour {
private Transform m_transform;
// Use this for initialization
void Start () {
m_transform = gameObject.GetComponent<Transform>();
}
// Update is called once per frame
void Update () {
if (Input.GetKey(KeyCode.Q)) {
m_transform.Rotate(Vector3.down * 10 * Time.deltaTime);
}
if (Input.GetKey(KeyCode.E)) {
m_transform.Rotate(Vector3.up * 10 * Time.deltaTime);
}
}
}
Unity3D学习记录——物体旋转
最新推荐文章于 2022-08-24 11:21:24 发布