docs.unity3d.com
    Show / Hide Table of Contents

    Class Vector2Extensions

    Extension methods for the Vector2 type

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

    Methods

    Abs(Vector2)

    Returns a vector where each component is the absolute value of the original (abs(x))

    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 absolute value vector

    Inverse(Vector2)

    Returns a vector where each component is inverted (1/x)

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

    The vector which will be inverted

    Returns
    Type Description
    Vector2

    The inverted vector

    MaxComponent(Vector2)

    Returns the maximum of all vector components

    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
    Single

    The maximum value

    MinComponent(Vector2)

    Returns the minimum of all vector components

    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
    Single

    The minimum value

    Back to top
    Terms of use
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023