docs.unity.cn
    Show / Hide Table of Contents

    Method asfloat

    asfloat(Int32)

    Returns the bit pattern of an int as a float.

    Declaration
    public static float asfloat(int x)
    Parameters
    Type Name Description
    Int32 x

    The int bits to copy.

    Returns
    Type Description
    Single

    The float with the same bit pattern as the input.

    asfloat(int2)

    Returns the bit pattern of an int2 as a float2.

    Declaration
    public static float2 asfloat(int2 x)
    Parameters
    Type Name Description
    int2 x

    The int2 bits to copy.

    Returns
    Type Description
    float2

    The float2 with the same bit pattern as the input.

    asfloat(int3)

    Returns the bit pattern of an int3 as a float3.

    Declaration
    public static float3 asfloat(int3 x)
    Parameters
    Type Name Description
    int3 x

    The int3 bits to copy.

    Returns
    Type Description
    float3

    The float3 with the same bit pattern as the input.

    asfloat(int4)

    Returns the bit pattern of an int4 as a float4.

    Declaration
    public static float4 asfloat(int4 x)
    Parameters
    Type Name Description
    int4 x

    The int4 bits to copy.

    Returns
    Type Description
    float4

    The float4 with the same bit pattern as the input.

    asfloat(UInt32)

    Returns the bit pattern of a uint as a float.

    Declaration
    public static float asfloat(uint x)
    Parameters
    Type Name Description
    UInt32 x

    The uint bits to copy.

    Returns
    Type Description
    Single

    The float with the same bit pattern as the input.

    asfloat(uint2)

    Returns the bit pattern of a uint2 as a float2.

    Declaration
    public static float2 asfloat(uint2 x)
    Parameters
    Type Name Description
    uint2 x

    The uint2 bits to copy.

    Returns
    Type Description
    float2

    The float2 with the same bit pattern as the input.

    asfloat(uint3)

    Returns the bit pattern of a uint3 as a float3.

    Declaration
    public static float3 asfloat(uint3 x)
    Parameters
    Type Name Description
    uint3 x

    The uint3 bits to copy.

    Returns
    Type Description
    float3

    The float3 with the same bit pattern as the input.

    asfloat(uint4)

    Returns the bit pattern of a uint4 as a float4.

    Declaration
    public static float4 asfloat(uint4 x)
    Parameters
    Type Name Description
    uint4 x

    The uint4 bits to copy.

    Returns
    Type Description
    float4

    The float4 with the same bit pattern as the input.

    Back to top
    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