docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Method select

    select(int, int, bool)

    Returns trueValue if test is true, falseValue otherwise.

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

    Value to use if test is false.

    int trueValue

    Value to use if test is true.

    bool test

    Bool value to choose between falseValue and trueValue.

    Returns
    Type Description
    int

    The selection between falseValue and trueValue according to bool test.

    select(int2, int2, bool)

    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.

    bool 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, bool)

    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.

    bool 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, bool)

    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.

    bool 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(uint, uint, bool)

    Returns trueValue if test is true, falseValue otherwise.

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

    Value to use if test is false.

    uint trueValue

    Value to use if test is true.

    bool test

    Bool value to choose between falseValue and trueValue.

    Returns
    Type Description
    uint

    The selection between falseValue and trueValue according to bool test.

    select(uint2, uint2, bool)

    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.

    bool 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, bool)

    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.

    bool 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, bool)

    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.

    bool 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(long, long, bool)

    Returns trueValue if test is true, falseValue otherwise.

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

    Value to use if test is false.

    long trueValue

    Value to use if test is true.

    bool test

    Bool value to choose between falseValue and trueValue.

    Returns
    Type Description
    long

    The selection between falseValue and trueValue according to bool test.

    select(ulong, ulong, bool)

    Returns trueValue if test is true, falseValue otherwise.

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

    Value to use if test is false.

    ulong trueValue

    Value to use if test is true.

    bool test

    Bool value to choose between falseValue and trueValue.

    Returns
    Type Description
    ulong

    The selection between falseValue and trueValue according to bool test.

    select(float, float, bool)

    Returns trueValue if test is true, falseValue otherwise.

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

    Value to use if test is false.

    float trueValue

    Value to use if test is true.

    bool test

    Bool value to choose between falseValue and trueValue.

    Returns
    Type Description
    float

    The selection between falseValue and trueValue according to bool test.

    select(float2, float2, bool)

    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.

    bool 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, bool)

    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.

    bool 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, bool)

    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.

    bool 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, bool)

    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.

    bool 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, bool)

    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.

    bool 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, bool)

    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.

    bool 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, bool)

    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.

    bool 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.

    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)