docs.unity.cn
    Show / Hide Table of Contents

    Method select

    select(Int32, Int32, Boolean)

    Returns trueValue if test is true, falseValue otherwise.

    Declaration
    public static int select(int falseValue, int trueValue, bool test)
    Parameters
    Type Name Description
    Int32 falseValue

    Value to use if test is false.

    Int32 trueValue

    Value to use if test is true.

    Boolean test

    Bool value to choose between falseValue and trueValue.

    Returns
    Type Description
    Int32

    The selection between falseValue and trueValue according to bool test.

    select(int2, int2, Boolean)

    Returns trueValue if test is true, falseValue otherwise.

    Declaration
    public static int2 select(int2 falseValue, int2 trueValue, bool test)
    Parameters
    Type Name Description
    int2 falseValue

    Value to use if test is false.

    int2 trueValue

    Value to use if test is true.

    Boolean test

    Bool value to choose between falseValue and trueValue.

    Returns
    Type Description
    int2

    The selection between falseValue and trueValue according to bool test.

    select(int3, int3, Boolean)

    Returns trueValue if test is true, falseValue otherwise.

    Declaration
    public static int3 select(int3 falseValue, int3 trueValue, bool test)
    Parameters
    Type Name Description
    int3 falseValue

    Value to use if test is false.

    int3 trueValue

    Value to use if test is true.

    Boolean test

    Bool value to choose between falseValue and trueValue.

    Returns
    Type Description
    int3

    The selection between falseValue and trueValue according to bool test.

    select(int4, int4, Boolean)

    Returns trueValue if test is true, falseValue otherwise.

    Declaration
    public static int4 select(int4 falseValue, int4 trueValue, bool test)
    Parameters
    Type Name Description
    int4 falseValue

    Value to use if test is false.

    int4 trueValue

    Value to use if test is true.

    Boolean test

    Bool value to choose between falseValue and trueValue.

    Returns
    Type Description
    int4

    The selection between falseValue and trueValue according to bool test.

    select(int2, int2, bool2)

    Returns a componentwise selection between two double4 vectors falseValue and trueValue based on a bool4 selection mask test. Per component, the component from trueValue is selected when test is true, otherwise the component from falseValue is selected.

    Declaration
    public static int2 select(int2 falseValue, int2 trueValue, bool2 test)
    Parameters
    Type Name Description
    int2 falseValue

    Values to use if test is false.

    int2 trueValue

    Values to use if test is true.

    bool2 test

    Selection mask to choose between falseValue and trueValue.

    Returns
    Type Description
    int2

    The componentwise selection between falseValue and trueValue according to selection mask test.

    select(int3, int3, bool3)

    Returns a componentwise selection between two double4 vectors falseValue and trueValue based on a bool4 selection mask test. Per component, the component from trueValue is selected when test is true, otherwise the component from falseValue is selected.

    Declaration
    public static int3 select(int3 falseValue, int3 trueValue, bool3 test)
    Parameters
    Type Name Description
    int3 falseValue

    Values to use if test is false.

    int3 trueValue

    Values to use if test is true.

    bool3 test

    Selection mask to choose between falseValue and trueValue.

    Returns
    Type Description
    int3

    The componentwise selection between falseValue and trueValue according to selection mask test.

    select(int4, int4, bool4)

    Returns a componentwise selection between two double4 vectors falseValue and trueValue based on a bool4 selection mask test. Per component, the component from trueValue is selected when test is true, otherwise the component from falseValue is selected.

    Declaration
    public static int4 select(int4 falseValue, int4 trueValue, bool4 test)
    Parameters
    Type Name Description
    int4 falseValue

    Values to use if test is false.

    int4 trueValue

    Values to use if test is true.

    bool4 test

    Selection mask to choose between falseValue and trueValue.

    Returns
    Type Description
    int4

    The componentwise selection between falseValue and trueValue according to selection mask test.

    select(UInt32, UInt32, Boolean)

    Returns trueValue if test is true, falseValue otherwise.

    Declaration
    public static uint select(uint falseValue, uint trueValue, bool test)
    Parameters
    Type Name Description
    UInt32 falseValue

    Value to use if test is false.

    UInt32 trueValue

    Value to use if test is true.

    Boolean test

    Bool value to choose between falseValue and trueValue.

    Returns
    Type Description
    UInt32

    The selection between falseValue and trueValue according to bool test.

    select(uint2, uint2, Boolean)

    Returns trueValue if test is true, falseValue otherwise.

    Declaration
    public static uint2 select(uint2 falseValue, uint2 trueValue, bool test)
    Parameters
    Type Name Description
    uint2 falseValue

    Value to use if test is false.

    uint2 trueValue

    Value to use if test is true.

    Boolean test

    Bool value to choose between falseValue and trueValue.

    Returns
    Type Description
    uint2

    The selection between falseValue and trueValue according to bool test.

    select(uint3, uint3, Boolean)

    Returns trueValue if test is true, falseValue otherwise.

    Declaration
    public static uint3 select(uint3 falseValue, uint3 trueValue, bool test)
    Parameters
    Type Name Description
    uint3 falseValue

    Value to use if test is false.

    uint3 trueValue

    Value to use if test is true.

    Boolean test

    Bool value to choose between falseValue and trueValue.

    Returns
    Type Description
    uint3

    The selection between falseValue and trueValue according to bool test.

    select(uint4, uint4, Boolean)

    Returns trueValue if test is true, falseValue otherwise.

    Declaration
    public static uint4 select(uint4 falseValue, uint4 trueValue, bool test)
    Parameters
    Type Name Description
    uint4 falseValue

    Value to use if test is false.

    uint4 trueValue

    Value to use if test is true.

    Boolean test

    Bool value to choose between falseValue and trueValue.

    Returns
    Type Description
    uint4

    The selection between falseValue and trueValue according to bool test.

    select(uint2, uint2, bool2)

    Returns a componentwise selection between two double4 vectors falseValue and trueValue based on a bool4 selection mask test. Per component, the component from trueValue is selected when test is true, otherwise the component from falseValue is selected.

    Declaration
    public static uint2 select(uint2 falseValue, uint2 trueValue, bool2 test)
    Parameters
    Type Name Description
    uint2 falseValue

    Values to use if test is false.

    uint2 trueValue

    Values to use if test is true.

    bool2 test

    Selection mask to choose between falseValue and trueValue.

    Returns
    Type Description
    uint2

    The componentwise selection between falseValue and trueValue according to selection mask test.

    select(uint3, uint3, bool3)

    Returns a componentwise selection between two double4 vectors falseValue and trueValue based on a bool4 selection mask test. Per component, the component from trueValue is selected when test is true, otherwise the component from falseValue is selected.

    Declaration
    public static uint3 select(uint3 falseValue, uint3 trueValue, bool3 test)
    Parameters
    Type Name Description
    uint3 falseValue

    Values to use if test is false.

    uint3 trueValue

    Values to use if test is true.

    bool3 test

    Selection mask to choose between falseValue and trueValue.

    Returns
    Type Description
    uint3

    The componentwise selection between falseValue and trueValue according to selection mask test.

    select(uint4, uint4, bool4)

    Returns a componentwise selection between two double4 vectors falseValue and trueValue based on a bool4 selection mask test. Per component, the component from trueValue is selected when test is true, otherwise the component from falseValue is selected.

    Declaration
    public static uint4 select(uint4 falseValue, uint4 trueValue, bool4 test)
    Parameters
    Type Name Description
    uint4 falseValue

    Values to use if test is false.

    uint4 trueValue

    Values to use if test is true.

    bool4 test

    Selection mask to choose between falseValue and trueValue.

    Returns
    Type Description
    uint4

    The componentwise selection between falseValue and trueValue according to selection mask test.

    select(Int64, Int64, Boolean)

    Returns trueValue if test is true, falseValue otherwise.

    Declaration
    public static long select(long falseValue, long trueValue, bool test)
    Parameters
    Type Name Description
    Int64 falseValue

    Value to use if test is false.

    Int64 trueValue

    Value to use if test is true.

    Boolean test

    Bool value to choose between falseValue and trueValue.

    Returns
    Type Description
    Int64

    The selection between falseValue and trueValue according to bool test.

    select(UInt64, UInt64, Boolean)

    Returns trueValue if test is true, falseValue otherwise.

    Declaration
    public static ulong select(ulong falseValue, ulong trueValue, bool test)
    Parameters
    Type Name Description
    UInt64 falseValue

    Value to use if test is false.

    UInt64 trueValue

    Value to use if test is true.

    Boolean test

    Bool value to choose between falseValue and trueValue.

    Returns
    Type Description
    UInt64

    The selection between falseValue and trueValue according to bool test.

    select(Single, Single, Boolean)

    Returns trueValue if test is true, falseValue otherwise.

    Declaration
    public static float select(float falseValue, float trueValue, bool test)
    Parameters
    Type Name Description
    Single falseValue

    Value to use if test is false.

    Single trueValue

    Value to use if test is true.

    Boolean test

    Bool value to choose between falseValue and trueValue.

    Returns
    Type Description
    Single

    The selection between falseValue and trueValue according to bool test.

    select(float2, float2, Boolean)

    Returns trueValue if test is true, falseValue otherwise.

    Declaration
    public static float2 select(float2 falseValue, float2 trueValue, bool test)
    Parameters
    Type Name Description
    float2 falseValue

    Value to use if test is false.

    float2 trueValue

    Value to use if test is true.

    Boolean test

    Bool value to choose between falseValue and trueValue.

    Returns
    Type Description
    float2

    The selection between falseValue and trueValue according to bool test.

    select(float3, float3, Boolean)

    Returns trueValue if test is true, falseValue otherwise.

    Declaration
    public static float3 select(float3 falseValue, float3 trueValue, bool test)
    Parameters
    Type Name Description
    float3 falseValue

    Value to use if test is false.

    float3 trueValue

    Value to use if test is true.

    Boolean test

    Bool value to choose between falseValue and trueValue.

    Returns
    Type Description
    float3

    The selection between falseValue and trueValue according to bool test.

    select(float4, float4, Boolean)

    Returns trueValue if test is true, falseValue otherwise.

    Declaration
    public static float4 select(float4 falseValue, float4 trueValue, bool test)
    Parameters
    Type Name Description
    float4 falseValue

    Value to use if test is false.

    float4 trueValue

    Value to use if test is true.

    Boolean test

    Bool value to choose between falseValue and trueValue.

    Returns
    Type Description
    float4

    The selection between falseValue and trueValue according to bool test.

    select(float2, float2, bool2)

    Returns a componentwise selection between two double4 vectors falseValue and trueValue based on a bool4 selection mask test. Per component, the component from trueValue is selected when test is true, otherwise the component from falseValue is selected.

    Declaration
    public static float2 select(float2 falseValue, float2 trueValue, bool2 test)
    Parameters
    Type Name Description
    float2 falseValue

    Values to use if test is false.

    float2 trueValue

    Values to use if test is true.

    bool2 test

    Selection mask to choose between falseValue and trueValue.

    Returns
    Type Description
    float2

    The componentwise selection between falseValue and trueValue according to selection mask test.

    select(float3, float3, bool3)

    Returns a componentwise selection between two double4 vectors falseValue and trueValue based on a bool4 selection mask test. Per component, the component from trueValue is selected when test is true, otherwise the component from falseValue is selected.

    Declaration
    public static float3 select(float3 falseValue, float3 trueValue, bool3 test)
    Parameters
    Type Name Description
    float3 falseValue

    Values to use if test is false.

    float3 trueValue

    Values to use if test is true.

    bool3 test

    Selection mask to choose between falseValue and trueValue.

    Returns
    Type Description
    float3

    The componentwise selection between falseValue and trueValue according to selection mask test.

    select(float4, float4, bool4)

    Returns a componentwise selection between two double4 vectors falseValue and trueValue based on a bool4 selection mask test. Per component, the component from trueValue is selected when test is true, otherwise the component from falseValue is selected.

    Declaration
    public static float4 select(float4 falseValue, float4 trueValue, bool4 test)
    Parameters
    Type Name Description
    float4 falseValue

    Values to use if test is false.

    float4 trueValue

    Values to use if test is true.

    bool4 test

    Selection mask to choose between falseValue and trueValue.

    Returns
    Type Description
    float4

    The componentwise selection between falseValue and trueValue according to selection mask test.

    select(Double, Double, Boolean)

    Returns trueValue if test is true, falseValue otherwise.

    Declaration
    public static double select(double falseValue, double trueValue, bool test)
    Parameters
    Type Name Description
    Double falseValue

    Value to use if test is false.

    Double trueValue

    Value to use if test is true.

    Boolean test

    Bool value to choose between falseValue and trueValue.

    Returns
    Type Description
    Double

    The selection between falseValue and trueValue according to bool test.

    select(double2, double2, Boolean)

    Returns trueValue if test is true, falseValue otherwise.

    Declaration
    public static double2 select(double2 falseValue, double2 trueValue, bool test)
    Parameters
    Type Name Description
    double2 falseValue

    Value to use if test is false.

    double2 trueValue

    Value to use if test is true.

    Boolean test

    Bool value to choose between falseValue and trueValue.

    Returns
    Type Description
    double2

    The selection between falseValue and trueValue according to bool test.

    select(double3, double3, Boolean)

    Returns trueValue if test is true, falseValue otherwise.

    Declaration
    public static double3 select(double3 falseValue, double3 trueValue, bool test)
    Parameters
    Type Name Description
    double3 falseValue

    Value to use if test is false.

    double3 trueValue

    Value to use if test is true.

    Boolean test

    Bool value to choose between falseValue and trueValue.

    Returns
    Type Description
    double3

    The selection between falseValue and trueValue according to bool test.

    select(double4, double4, Boolean)

    Returns trueValue if test is true, falseValue otherwise.

    Declaration
    public static double4 select(double4 falseValue, double4 trueValue, bool test)
    Parameters
    Type Name Description
    double4 falseValue

    Value to use if test is false.

    double4 trueValue

    Value to use if test is true.

    Boolean test

    Bool value to choose between falseValue and trueValue.

    Returns
    Type Description
    double4

    The selection between falseValue and trueValue according to bool test.

    select(double2, double2, bool2)

    Returns a componentwise selection between two double4 vectors falseValue and trueValue based on a bool4 selection mask test. Per component, the component from trueValue is selected when test is true, otherwise the component from falseValue is selected.

    Declaration
    public static double2 select(double2 falseValue, double2 trueValue, bool2 test)
    Parameters
    Type Name Description
    double2 falseValue

    Values to use if test is false.

    double2 trueValue

    Values to use if test is true.

    bool2 test

    Selection mask to choose between falseValue and trueValue.

    Returns
    Type Description
    double2

    The componentwise selection between falseValue and trueValue according to selection mask test.

    select(double3, double3, bool3)

    Returns a componentwise selection between two double4 vectors falseValue and trueValue based on a bool4 selection mask test. Per component, the component from trueValue is selected when test is true, otherwise the component from falseValue is selected.

    Declaration
    public static double3 select(double3 falseValue, double3 trueValue, bool3 test)
    Parameters
    Type Name Description
    double3 falseValue

    Values to use if test is false.

    double3 trueValue

    Values to use if test is true.

    bool3 test

    Selection mask to choose between falseValue and trueValue.

    Returns
    Type Description
    double3

    The componentwise selection between falseValue and trueValue according to selection mask test.

    select(double4, double4, bool4)

    Returns a componentwise selection between two double4 vectors falseValue and trueValue based on a bool4 selection mask test. Per component, the component from trueValue is selected when test is true, otherwise the component from falseValue is selected.

    Declaration
    public static double4 select(double4 falseValue, double4 trueValue, bool4 test)
    Parameters
    Type Name Description
    double4 falseValue

    Values to use if test is false.

    double4 trueValue

    Values to use if test is true.

    bool4 test

    Selection mask to choose between falseValue and trueValue.

    Returns
    Type Description
    double4

    The componentwise selection between falseValue and trueValue according to selection mask test.

    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