docs.unity.cn
    Show / Hide Table of Contents

    Method step

    step(Single, Single)

    Returns the result of a step function where the result is 1.0f when x >= threshold and 0.0f otherwise.

    Declaration
    public static float step(float threshold, float x)
    Parameters
    Type Name Description
    Single threshold

    Value to be used as a threshold for returning 1.

    Single x

    Value to compare against threshold.

    Returns
    Type Description
    Single

    1 if the comparison x >= threshold is true, otherwise 0.

    step(float2, float2)

    Returns the result of a componentwise step function where each component is 1.0f when x >= threshold and 0.0f otherwise.

    Declaration
    public static float2 step(float2 threshold, float2 x)
    Parameters
    Type Name Description
    float2 threshold

    Vector of values to be used as a threshold for returning 1.

    float2 x

    Vector of values to compare against threshold.

    Returns
    Type Description
    float2

    1 if the componentwise comparison x >= threshold is true, otherwise 0.

    step(float3, float3)

    Returns the result of a componentwise step function where each component is 1.0f when x >= threshold and 0.0f otherwise.

    Declaration
    public static float3 step(float3 threshold, float3 x)
    Parameters
    Type Name Description
    float3 threshold

    Vector of values to be used as a threshold for returning 1.

    float3 x

    Vector of values to compare against threshold.

    Returns
    Type Description
    float3

    1 if the componentwise comparison x >= threshold is true, otherwise 0.

    step(float4, float4)

    Returns the result of a componentwise step function where each component is 1.0f when x >= threshold and 0.0f otherwise.

    Declaration
    public static float4 step(float4 threshold, float4 x)
    Parameters
    Type Name Description
    float4 threshold

    Vector of values to be used as a threshold for returning 1.

    float4 x

    Vector of values to compare against threshold.

    Returns
    Type Description
    float4

    1 if the componentwise comparison x >= threshold is true, otherwise 0.

    step(Double, Double)

    Returns the result of a step function where the result is 1.0f when x >= threshold and 0.0f otherwise.

    Declaration
    public static double step(double threshold, double x)
    Parameters
    Type Name Description
    Double threshold

    Values to be used as a threshold for returning 1.

    Double x

    Value to compare against threshold.

    Returns
    Type Description
    Double

    1 if the comparison x >= threshold is true, otherwise 0.

    step(double2, double2)

    Returns the result of a componentwise step function where each component is 1.0f when x >= threshold and 0.0f otherwise.

    Declaration
    public static double2 step(double2 threshold, double2 x)
    Parameters
    Type Name Description
    double2 threshold

    Vector of values to be used as a threshold for returning 1.

    double2 x

    Vector of values to compare against threshold.

    Returns
    Type Description
    double2

    1 if the componentwise comparison x >= threshold is true, otherwise 0.

    step(double3, double3)

    Returns the result of a componentwise step function where each component is 1.0f when x >= threshold and 0.0f otherwise.

    Declaration
    public static double3 step(double3 threshold, double3 x)
    Parameters
    Type Name Description
    double3 threshold

    Vector of values to be used as a threshold for returning 1.

    double3 x

    Vector of values to compare against threshold.

    Returns
    Type Description
    double3

    1 if the componentwise comparison x >= threshold is true, otherwise 0.

    step(double4, double4)

    Returns the result of a componentwise step function where each component is 1.0f when x >= threshold and 0.0f otherwise.

    Declaration
    public static double4 step(double4 threshold, double4 x)
    Parameters
    Type Name Description
    double4 threshold

    Vector of values to be used as a threshold for returning 1.

    double4 x

    Vector of values to compare against threshold.

    Returns
    Type Description
    double4

    1 if the componentwise comparison x >= threshold is true, otherwise 0.

    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