public class RotationController : MonoBehaviour
{
public float speedX = 20f;
public float speedY = 30f;
public float speedZ = 40f;
private Transform tr;
void Awake()
{
tr = GetComponent<Transform>();
}
void Update()
{
tr.Rotate(speedX * Time.deltaTime, speedY * Time.deltaTime, speedZ * Time.deltaTime);
}
}
unity物体自身旋转
于 2023-12-12 09:48:10 首次发布