docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class Vector2Extensions

    Extension methods for the Vector2 type.

    Inheritance
    object
    Vector2Extensions
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Unity.XR.CoreUtils
    Assembly: Unity.XR.CoreUtils.dll
    Syntax
    public static class Vector2Extensions

    Methods

    Abs(Vector2)

    Returns the component-wise absolute value of this vector [abs(x), abs(y)].

    Declaration
    public static Vector2 Abs(this Vector2 vector)
    Parameters
    Type Name Description
    Vector2 vector

    The vector whose absolute value will be returned.

    Returns
    Type Description
    Vector2

    The component-wise absolute value of this vector.

    Inverse(Vector2)

    Returns the component-wise inverse of this vector [1/x, 1/y].

    Declaration
    public static Vector2 Inverse(this Vector2 vector)
    Parameters
    Type Name Description
    Vector2 vector

    The vector to invert.

    Returns
    Type Description
    Vector2

    The inverted vector.

    MaxComponent(Vector2)

    Returns the largest component of this vector.

    Declaration
    public static float MaxComponent(this Vector2 vector)
    Parameters
    Type Name Description
    Vector2 vector

    The vector whose maximum component will be returned.

    Returns
    Type Description
    float

    The maximum value.

    MinComponent(Vector2)

    Returns the smallest component of this vector.

    Declaration
    public static float MinComponent(this Vector2 vector)
    Parameters
    Type Name Description
    Vector2 vector

    The vector whose minimum component will be returned.

    Returns
    Type Description
    float

    The minimum value.

    In This Article
    Back to top
    Copyright © 2025 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)