Vector3.Reflect 反射

static function Reflect (inDirection : Vector3, inNormal : Vector3) : Vector3


Reflects the vector along the normal.


The returned value is inDirection reflected from a surface with a normal inNormal.


using UnityEngine;
using System.Collections;

public class example : MonoBehaviour {
	public Transform originalObject;
	public Transform reflectedObject;
	void Update() {
		eflectedObject.position = Vector3.Reflect(originalObject.position, Vector3.right);
var originalObject : Transform;
var reflectedObject : Transform;

function Update () {
	// Makes the reflected object appear opposite of the original object,
	// mirrored along the z-axis of the world
	reflectedObject.position = Vector3.Reflect (originalObject.position, Vector3.right);
Page last updated: 2010-12-20