QQ群:476842922(欢迎加群讨论学习)
using UnityEngine;
using System.Collections;

public class Spin : MonoBehaviour {

	public float speed=1.0f;
	// Use this for initialization
	void Start () {
	
	}
	
	// Update is called once per frame
	void Update () {
		transform.Rotate (0, speed, 0);////分别绕X,Y,Z轴旋转
	}
}

创建代码后直接拖到立方体上即可实现旋转。

unit3d物体旋转代码

相关文章:

  • 2022-12-23
  • 2021-04-27
  • 2021-09-17
  • 2021-08-03
  • 2022-12-23
  • 2022-01-29
  • 2021-09-24
  • 2021-10-23
猜你喜欢
  • 2021-10-10
  • 2022-01-15
  • 2021-08-10
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案