Vector3.operator == 运算符 等于

static operator == (lhs : Vector3, rhs : Vector3) : bool

Description描述

Returns true if the vectors are equal.

如果两个向量相等,返回真。

This will also return true for vectors that are really close to being equal.

对于非常接近相等向量,也将返回真。

using UnityEngine;
using System.Collections;

public class example : MonoBehaviour {
	public Transform other;
	public void Awake() {
		if (other && transform.position == other.position)
			print("I'm at the same place as the other transform!");

	}	
}
var other : Transform;
if (other && transform.position == other.position)
	print ("I'm at the same place as the other transform!");
最后修改:2010年12月20日 Monday 23:36

本脚本参考基于Unity 3.4.1f5

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