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!");