Ray.Ray 射线

static function Ray (origin : Vector3, direction : Vector3) : Ray

Description描述

Creates a ray starting at origin along direction.

创建一个新的射线,开始于origin沿着direction的方向。

using UnityEngine;
using System.Collections;

public class example : MonoBehaviour {
	public Ray ray = new Ray(transform.position, transform.forward);
}
// Create a ray from the transform position along the transform's z-axis
//创建一个光线,开始于变换位置沿着变换的z轴

var ray = new Ray (transform.position, transform.forward);
Page last updated: 2010-12-23