Transform.RotateAround 围绕旋转
function RotateAround (point : Vector3, axis : Vector3, angle : float) : void
Description描述
Rotates the transform about axis passing through point in world coordinates by angle degrees.
按照angle度通过在世界坐标的point轴旋转物体。
简单的说,按照多少度在世界坐标的某位置轴旋转物体。
This modifies both the position and the rotation of the transform.
这个修改变换的位置和旋转角度。
C#
JavaScript
using UnityEngine;using System.Collections;public class example : MonoBehaviour {void Update() {transform.RotateAround(Vector3.zero, Vector3.up, 20 * Time.deltaTime);}}
function Update() {// Spin the object around the world origin at 20 degrees/second.//围绕世界坐标原点,每秒20度物体自旋transform.RotateAround (Vector3.zero, Vector3.up, 20 * Time.deltaTime);}