Version: Unity 6.5 Alpha (6000.5)
LanguageEnglish
  • C#

math.select

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Declaration

public static int select(int falseValue, int trueValue, bool test);

Parameters

Parameter Description
falseValue Value to use if test is false.
trueValue Value to use if test is true.
test Bool value to choose between falseValue and trueValue.

Returns

int The selection between falseValue and trueValue according to bool test.

Description

Returns trueValue if test is true, falseValue otherwise.


Declaration

public static int2 select(int2 falseValue, int2 trueValue, bool test);

Parameters

Parameter Description
falseValue Value to use if test is false.
trueValue Value to use if test is true.
test Bool value to choose between falseValue and trueValue.

Returns

int2 The selection between falseValue and trueValue according to bool test.

Description

Returns trueValue if test is true, falseValue otherwise.


Declaration

public static int3 select(int3 falseValue, int3 trueValue, bool test);

Parameters

Parameter Description
falseValue Value to use if test is false.
trueValue Value to use if test is true.
test Bool value to choose between falseValue and trueValue.

Returns

int3 The selection between falseValue and trueValue according to bool test.

Description

Returns trueValue if test is true, falseValue otherwise.


Declaration

public static int4 select(int4 falseValue, int4 trueValue, bool test);

Parameters

Parameter Description
falseValue Value to use if test is false.
trueValue Value to use if test is true.
test Bool value to choose between falseValue and trueValue.

Returns

int4 The selection between falseValue and trueValue according to bool test.

Description

Returns trueValue if test is true, falseValue otherwise.


Declaration

public static int2 select(int2 falseValue, int2 trueValue, bool2 test);

Parameters

Parameter Description
falseValue Values to use if test is false.
trueValue Values to use if test is true.
test Selection mask to choose between falseValue and trueValue.

Returns

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

Description

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

Parameter Description
falseValue Values to use if test is false.
trueValue Values to use if test is true.
test Selection mask to choose between falseValue and trueValue.

Returns

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

Description

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

Parameter Description
falseValue Values to use if test is false.
trueValue Values to use if test is true.
test Selection mask to choose between falseValue and trueValue.

Returns

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

Description

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 uint select(uint falseValue, uint trueValue, bool test);

Parameters

Parameter Description
falseValue Value to use if test is false.
trueValue Value to use if test is true.
test Bool value to choose between falseValue and trueValue.

Returns

uint The selection between falseValue and trueValue according to bool test.

Description

Returns trueValue if test is true, falseValue otherwise.


Declaration

public static uint2 select(uint2 falseValue, uint2 trueValue, bool test);

Parameters

Parameter Description
falseValue Value to use if test is false.
trueValue Value to use if test is true.
test Bool value to choose between falseValue and trueValue.

Returns

uint2 The selection between falseValue and trueValue according to bool test.

Description

Returns trueValue if test is true, falseValue otherwise.


Declaration

public static uint3 select(uint3 falseValue, uint3 trueValue, bool test);

Parameters

Parameter Description
falseValue Value to use if test is false.
trueValue Value to use if test is true.
test Bool value to choose between falseValue and trueValue.

Returns

uint3 The selection between falseValue and trueValue according to bool test.

Description

Returns trueValue if test is true, falseValue otherwise.


Declaration

public static uint4 select(uint4 falseValue, uint4 trueValue, bool test);

Parameters

Parameter Description
falseValue Value to use if test is false.
trueValue Value to use if test is true.
test Bool value to choose between falseValue and trueValue.

Returns

uint4 The selection between falseValue and trueValue according to bool test.

Description

Returns trueValue if test is true, falseValue otherwise.


Declaration

public static uint2 select(uint2 falseValue, uint2 trueValue, bool2 test);

Parameters

Parameter Description
falseValue Values to use if test is false.
trueValue Values to use if test is true.
test Selection mask to choose between falseValue and trueValue.

Returns

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

Description

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

Parameter Description
falseValue Values to use if test is false.
trueValue Values to use if test is true.
test Selection mask to choose between falseValue and trueValue.

Returns

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

Description

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

Parameter Description
falseValue Values to use if test is false.
trueValue Values to use if test is true.
test Selection mask to choose between falseValue and trueValue.

Returns

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

Description

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 long select(long falseValue, long trueValue, bool test);

Parameters

Parameter Description
falseValue Value to use if test is false.
trueValue Value to use if test is true.
test Bool value to choose between falseValue and trueValue.

Returns

long The selection between falseValue and trueValue according to bool test.

Description

Returns trueValue if test is true, falseValue otherwise.


Declaration

public static ulong select(ulong falseValue, ulong trueValue, bool test);

Parameters

Parameter Description
falseValue Value to use if test is false.
trueValue Value to use if test is true.
test Bool value to choose between falseValue and trueValue.

Returns

ulong The selection between falseValue and trueValue according to bool test.

Description

Returns trueValue if test is true, falseValue otherwise.


Declaration

public static float select(float falseValue, float trueValue, bool test);

Parameters

Parameter Description
falseValue Value to use if test is false.
trueValue Value to use if test is true.
test Bool value to choose between falseValue and trueValue.

Returns

float The selection between falseValue and trueValue according to bool test.

Description

Returns trueValue if test is true, falseValue otherwise.


Declaration

public static float2 select(float2 falseValue, float2 trueValue, bool test);

Parameters

Parameter Description
falseValue Value to use if test is false.
trueValue Value to use if test is true.
test Bool value to choose between falseValue and trueValue.

Returns

float2 The selection between falseValue and trueValue according to bool test.

Description

Returns trueValue if test is true, falseValue otherwise.


Declaration

public static float3 select(float3 falseValue, float3 trueValue, bool test);

Parameters

Parameter Description
falseValue Value to use if test is false.
trueValue Value to use if test is true.
test Bool value to choose between falseValue and trueValue.

Returns

float3 The selection between falseValue and trueValue according to bool test.

Description

Returns trueValue if test is true, falseValue otherwise.


Declaration

public static float4 select(float4 falseValue, float4 trueValue, bool test);

Parameters

Parameter Description
falseValue Value to use if test is false.
trueValue Value to use if test is true.
test Bool value to choose between falseValue and trueValue.

Returns

float4 The selection between falseValue and trueValue according to bool test.

Description

Returns trueValue if test is true, falseValue otherwise.


Declaration

public static float2 select(float2 falseValue, float2 trueValue, bool2 test);

Parameters

Parameter Description
falseValue Values to use if test is false.
trueValue Values to use if test is true.
test Selection mask to choose between falseValue and trueValue.

Returns

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

Description

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

Parameter Description
falseValue Values to use if test is false.
trueValue Values to use if test is true.
test Selection mask to choose between falseValue and trueValue.

Returns

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

Description

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

Parameter Description
falseValue Values to use if test is false.
trueValue Values to use if test is true.
test Selection mask to choose between falseValue and trueValue.

Returns

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

Description

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 double select(double falseValue, double trueValue, bool test);

Parameters

Parameter Description
falseValue Value to use if test is false.
trueValue Value to use if test is true.
test Bool value to choose between falseValue and trueValue.

Returns

double The selection between falseValue and trueValue according to bool test.

Description

Returns trueValue if test is true, falseValue otherwise.


Declaration

public static double2 select(double2 falseValue, double2 trueValue, bool test);

Parameters

Parameter Description
falseValue Value to use if test is false.
trueValue Value to use if test is true.
test Bool value to choose between falseValue and trueValue.

Returns

double2 The selection between falseValue and trueValue according to bool test.

Description

Returns trueValue if test is true, falseValue otherwise.


Declaration

public static double3 select(double3 falseValue, double3 trueValue, bool test);

Parameters

Parameter Description
falseValue Value to use if test is false.
trueValue Value to use if test is true.
test Bool value to choose between falseValue and trueValue.

Returns

double3 The selection between falseValue and trueValue according to bool test.

Description

Returns trueValue if test is true, falseValue otherwise.


Declaration

public static double4 select(double4 falseValue, double4 trueValue, bool test);

Parameters

Parameter Description
falseValue Value to use if test is false.
trueValue Value to use if test is true.
test Bool value to choose between falseValue and trueValue.

Returns

double4 The selection between falseValue and trueValue according to bool test.

Description

Returns trueValue if test is true, falseValue otherwise.


Declaration

public static double2 select(double2 falseValue, double2 trueValue, bool2 test);

Parameters

Parameter Description
falseValue Values to use if test is false.
trueValue Values to use if test is true.
test Selection mask to choose between falseValue and trueValue.

Returns

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

Description

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

Parameter Description
falseValue Values to use if test is false.
trueValue Values to use if test is true.
test Selection mask to choose between falseValue and trueValue.

Returns

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

Description

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

Parameter Description
falseValue Values to use if test is false.
trueValue Values to use if test is true.
test Selection mask to choose between falseValue and trueValue.

Returns

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

Description

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.