Class ArrayUtilities
Utility class for converting Array types from one type to another without copying.
Namespace: Unity.Simulation
Syntax
public static class ArrayUtilities
Methods
Allocate<T>(Int32)
Declaration
public static T[] Allocate<T>(int length)
Parameters
Type | Name | Description |
---|---|---|
Int32 | length |
Returns
Type | Description |
---|---|
T[] |
Type Parameters
Name | Description |
---|---|
T |
Cast<T>(Array)
Casts an input array to type T if supported by the cast map.
Declaration
public static T[] Cast<T>(Array array)
Parameters
Type | Name | Description |
---|---|---|
Array | array | Input array to be casted. |
Returns
Type | Description |
---|---|
T[] | Array of type T. |
Type Parameters
Name | Description |
---|---|
T | Cast type. |
Count<T>(T[])
Returns actual count of a casted array.
Declaration
public static int Count<T>(T[] array)
Parameters
Type | Name | Description |
---|---|---|
T[] | array | Input casted array |
Returns
Type | Description |
---|---|
Int32 | Actual count of a casted array |
Type Parameters
Name | Description |
---|---|
T | Cast type. |