docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Method float2

    float2(float, float)

    Returns a float2 vector constructed from two float values.

    Declaration
    public static float2 float2(float x, float y)
    Parameters
    Type Name Description
    float x

    The constructed vector's x component will be set to this value.

    float y

    The constructed vector's y component will be set to this value.

    Returns
    Type Description
    float2

    float2 constructed from arguments.

    float2(float2)

    Returns a float2 vector constructed from a float2 vector.

    Declaration
    public static float2 float2(float2 xy)
    Parameters
    Type Name Description
    float2 xy

    The constructed vector's xy components will be set to this value.

    Returns
    Type Description
    float2

    float2 constructed from arguments.

    float2(float)

    Returns a float2 vector constructed from a single float value by assigning it to every component.

    Declaration
    public static float2 float2(float v)
    Parameters
    Type Name Description
    float v

    float to convert to float2

    Returns
    Type Description
    float2

    Converted value.

    float2(bool)

    Returns a float2 vector constructed from a single bool value by converting it to float and assigning it to every component.

    Declaration
    public static float2 float2(bool v)
    Parameters
    Type Name Description
    bool v

    bool to convert to float2

    Returns
    Type Description
    float2

    Converted value.

    float2(bool2)

    Return a float2 vector constructed from a bool2 vector by componentwise conversion.

    Declaration
    public static float2 float2(bool2 v)
    Parameters
    Type Name Description
    bool2 v

    bool2 to convert to float2

    Returns
    Type Description
    float2

    Converted value.

    float2(int)

    Returns a float2 vector constructed from a single int value by converting it to float and assigning it to every component.

    Declaration
    public static float2 float2(int v)
    Parameters
    Type Name Description
    int v

    int to convert to float2

    Returns
    Type Description
    float2

    Converted value.

    float2(int2)

    Return a float2 vector constructed from a int2 vector by componentwise conversion.

    Declaration
    public static float2 float2(int2 v)
    Parameters
    Type Name Description
    int2 v

    int2 to convert to float2

    Returns
    Type Description
    float2

    Converted value.

    float2(uint)

    Returns a float2 vector constructed from a single uint value by converting it to float and assigning it to every component.

    Declaration
    public static float2 float2(uint v)
    Parameters
    Type Name Description
    uint v

    uint to convert to float2

    Returns
    Type Description
    float2

    Converted value.

    float2(uint2)

    Return a float2 vector constructed from a uint2 vector by componentwise conversion.

    Declaration
    public static float2 float2(uint2 v)
    Parameters
    Type Name Description
    uint2 v

    uint2 to convert to float2

    Returns
    Type Description
    float2

    Converted value.

    float2(half)

    Returns a float2 vector constructed from a single half value by converting it to float and assigning it to every component.

    Declaration
    public static float2 float2(half v)
    Parameters
    Type Name Description
    half v

    half to convert to float2

    Returns
    Type Description
    float2

    Converted value.

    float2(half2)

    Return a float2 vector constructed from a half2 vector by componentwise conversion.

    Declaration
    public static float2 float2(half2 v)
    Parameters
    Type Name Description
    half2 v

    half2 to convert to float2

    Returns
    Type Description
    float2

    Converted value.

    float2(double)

    Returns a float2 vector constructed from a single double value by converting it to float and assigning it to every component.

    Declaration
    public static float2 float2(double v)
    Parameters
    Type Name Description
    double v

    double to convert to float2

    Returns
    Type Description
    float2

    Converted value.

    float2(double2)

    Return a float2 vector constructed from a double2 vector by componentwise conversion.

    Declaration
    public static float2 float2(double2 v)
    Parameters
    Type Name Description
    double2 v

    double2 to convert to float2

    Returns
    Type Description
    float2

    Converted value.

    In This Article
    Back to top
    Copyright © 2024 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)