Vector3.operator ==

Unity · Версия 2020.3 LTS · Scripting · Vector3

Vector3.operator ==

public static bool operator ==(Vector3 lhs, Vector3 rhs);

Описание

Возвращает значение true, если два вектора примерно равны.

Чтобы учесть неточности с плавающей запятой, два вектора считаются равными, если величина их разности меньше 1e-5.

Смотрите так же: Equals

using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour
{
    public Transform other;

    void Example()
    {
        if (other && transform.position == other.position)
        {
            print("I'm at the same place as the other transform!");
        }
    }
}

Обновлено 17 ноября 2026 г.