用户工具

站点工具


侧边栏

script:unityengine:classes:transform:transform.rotatearound

Transform.RotateAround 围绕旋转

JavaScript ⇒ RotateAround(point: Vector3, axis: Vector3, angle: float): void;
C# ⇒ void RotateAround(Vector3 point, Vector3 axis, float angle);

Description 描述

Rotates the transform about axis passing through point in world coordinates by angle degrees.

围绕世界坐标的point点的axis旋转该变换angle度。

This modifies both the position and the rotation of the transform.

这个修改变换的位置和旋转角度。

JavaScript:

function Update() {
	// Spin the object around the world origin at 20 degrees/second.
	transform.RotateAround (Vector3.zero, Vector3.up, 20 * Time.deltaTime);
}

C#:

using UnityEngine;
using System.Collections;
 
public class ExampleClass : MonoBehaviour {
    void Update() {
        transform.RotateAround(Vector3.zero, Vector3.up, 20 * Time.deltaTime);
    }
}

Transform

script/unityengine/classes/transform/transform.rotatearound.txt · 最后更改: 2016/08/02 05:37 (外部编辑)