docs.unity.cn
    Show / Hide Table of Contents

    Method asint

    asint(UInt32)

    Returns the bit pattern of a uint as an int.

    Declaration
    public static int asint(uint x)
    Parameters
    Type Name Description
    UInt32 x

    The uint bits to copy.

    Returns
    Type Description
    Int32

    The int with the same bit pattern as the input.

    asint(uint2)

    Returns the bit pattern of a uint2 as an int2.

    Declaration
    public static int2 asint(uint2 x)
    Parameters
    Type Name Description
    uint2 x

    The uint2 bits to copy.

    Returns
    Type Description
    int2

    The int2 with the same bit pattern as the input.

    asint(uint3)

    Returns the bit pattern of a uint3 as an int3.

    Declaration
    public static int3 asint(uint3 x)
    Parameters
    Type Name Description
    uint3 x

    The uint3 bits to copy.

    Returns
    Type Description
    int3

    The int3 with the same bit pattern as the input.

    asint(uint4)

    Returns the bit pattern of a uint4 as an int4.

    Declaration
    public static int4 asint(uint4 x)
    Parameters
    Type Name Description
    uint4 x

    The uint4 bits to copy.

    Returns
    Type Description
    int4

    The int4 with the same bit pattern as the input.

    asint(Single)

    Returns the bit pattern of a float as an int.

    Declaration
    public static int asint(float x)
    Parameters
    Type Name Description
    Single x

    The float bits to copy.

    Returns
    Type Description
    Int32

    The int with the same bit pattern as the input.

    asint(float2)

    Returns the bit pattern of a float2 as an int2.

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

    The float2 bits to copy.

    Returns
    Type Description
    int2

    The int2 with the same bit pattern as the input.

    asint(float3)

    Returns the bit pattern of a float3 as an int3.

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

    The float3 bits to copy.

    Returns
    Type Description
    int3

    The int3 with the same bit pattern as the input.

    asint(float4)

    Returns the bit pattern of a float4 as an int4.

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

    The float4 bits to copy.

    Returns
    Type Description
    int4

    The int4 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