Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


select

Returns trueValue if test is true, falseValue otherwise.
Read time 11 minutesLast updated 6 days ago

Definition

select(int, int, bool)

Returns trueValue if test is true, falseValue otherwise.
public static int select(int falseValue, int trueValue, bool test)

Parameters

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

Type

Description

intThe selection between falseValue and trueValue according to bool test.

select(int2, int2, bool)

Returns trueValue if test is true, falseValue otherwise.
public static int2 select(int2 falseValue, int2 trueValue, bool test)

Parameters

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

Type

Description

int2The selection between falseValue and trueValue according to bool test.

select(int3, int3, bool)

Returns trueValue if test is true, falseValue otherwise.
public static int3 select(int3 falseValue, int3 trueValue, bool test)

Parameters

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

Type

Description

int3The selection between falseValue and trueValue according to bool test.

select(int4, int4, bool)

Returns trueValue if test is true, falseValue otherwise.
public static int4 select(int4 falseValue, int4 trueValue, bool test)

Parameters

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

Type

Description

int4The 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.
public static int2 select(int2 falseValue, int2 trueValue, bool2 test)

Parameters

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

Type

Description

int2The 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.
public static int3 select(int3 falseValue, int3 trueValue, bool3 test)

Parameters

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

Type

Description

int3The 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.
public static int4 select(int4 falseValue, int4 trueValue, bool4 test)

Parameters

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

Type

Description

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

select(uint, uint, bool)

Returns trueValue if test is true, falseValue otherwise.
public static uint select(uint falseValue, uint trueValue, bool test)

Parameters

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

Type

Description

uintThe selection between falseValue and trueValue according to bool test.

select(uint2, uint2, bool)

Returns trueValue if test is true, falseValue otherwise.
public static uint2 select(uint2 falseValue, uint2 trueValue, bool test)

Parameters

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

Type

Description

uint2The selection between falseValue and trueValue according to bool test.

select(uint3, uint3, bool)

Returns trueValue if test is true, falseValue otherwise.
public static uint3 select(uint3 falseValue, uint3 trueValue, bool test)

Parameters

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

Type

Description

uint3The selection between falseValue and trueValue according to bool test.

select(uint4, uint4, bool)

Returns trueValue if test is true, falseValue otherwise.
public static uint4 select(uint4 falseValue, uint4 trueValue, bool test)

Parameters

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

Type

Description

uint4The 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.
public static uint2 select(uint2 falseValue, uint2 trueValue, bool2 test)

Parameters

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

Type

Description

uint2The 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.
public static uint3 select(uint3 falseValue, uint3 trueValue, bool3 test)

Parameters

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

Type

Description

uint3The 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.
public static uint4 select(uint4 falseValue, uint4 trueValue, bool4 test)

Parameters

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

Type

Description

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

select(long, long, bool)

Returns trueValue if test is true, falseValue otherwise.
public static long select(long falseValue, long trueValue, bool test)

Parameters

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

Type

Description

longThe selection between falseValue and trueValue according to bool test.

select(ulong, ulong, bool)

Returns trueValue if test is true, falseValue otherwise.
public static ulong select(ulong falseValue, ulong trueValue, bool test)

Parameters

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

Type

Description

ulongThe selection between falseValue and trueValue according to bool test.

select(float, float, bool)

Returns trueValue if test is true, falseValue otherwise.
public static float select(float falseValue, float trueValue, bool test)

Parameters

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

Type

Description

floatThe selection between falseValue and trueValue according to bool test.

select(float2, float2, bool)

Returns trueValue if test is true, falseValue otherwise.
public static float2 select(float2 falseValue, float2 trueValue, bool test)

Parameters

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

Type

Description

float2The selection between falseValue and trueValue according to bool test.

select(float3, float3, bool)

Returns trueValue if test is true, falseValue otherwise.
public static float3 select(float3 falseValue, float3 trueValue, bool test)

Parameters

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

Type

Description

float3The selection between falseValue and trueValue according to bool test.

select(float4, float4, bool)

Returns trueValue if test is true, falseValue otherwise.
public static float4 select(float4 falseValue, float4 trueValue, bool test)

Parameters

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

Type

Description

float4The 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.
public static float2 select(float2 falseValue, float2 trueValue, bool2 test)

Parameters

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

Type

Description

float2The 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.
public static float3 select(float3 falseValue, float3 trueValue, bool3 test)

Parameters

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

Type

Description

float3The 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.
public static float4 select(float4 falseValue, float4 trueValue, bool4 test)

Parameters

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

Type

Description

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

select(double, double, bool)

Returns trueValue if test is true, falseValue otherwise.
public static double select(double falseValue, double trueValue, bool test)

Parameters

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

Type

Description

doubleThe selection between falseValue and trueValue according to bool test.

select(double2, double2, bool)

Returns trueValue if test is true, falseValue otherwise.
public static double2 select(double2 falseValue, double2 trueValue, bool test)

Parameters

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

Type

Description

double2The selection between falseValue and trueValue according to bool test.

select(double3, double3, bool)

Returns trueValue if test is true, falseValue otherwise.
public static double3 select(double3 falseValue, double3 trueValue, bool test)

Parameters

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

Type

Description

double3The selection between falseValue and trueValue according to bool test.

select(double4, double4, bool)

Returns trueValue if test is true, falseValue otherwise.
public static double4 select(double4 falseValue, double4 trueValue, bool test)

Parameters

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

Type

Description

double4The 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.
public static double2 select(double2 falseValue, double2 trueValue, bool2 test)

Parameters

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

Type

Description

double2The 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.
public static double3 select(double3 falseValue, double3 trueValue, bool3 test)

Parameters

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

Type

Description

double3The 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.
public static double4 select(double4 falseValue, double4 trueValue, bool4 test)

Parameters

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

Type

Description

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