Transform.up 向上

var up : Vector3

Description描述

The green axis of the transform in world space.

在世界空间坐标变换的绿色轴。也就是y轴。

using UnityEngine;
using System.Collections;

public class example : MonoBehaviour {
	public void Awake() {
		rigidbody.velocity = transform.up * 10;
	}
}
// Set's the rigidbody velocity to be
// along the green axis of the transform
//设置刚体的速度沿着物体的绿色轴移动
rigidbody.velocity = transform.up * 10;
最后修改:2010年12月18日 Saturday 22:55

本脚本参考基于Unity 3.4.1f5

英文部分版权属©Unity公司所有,中文部分© Unity圣典 版权所有,未经许可,严禁转载 。