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;
Page last updated: 2010-12-18