ListExt.Shuffled<T> Method
Returns a list with the input list elements shuffled.
Namespace: UltimateXR.Extensions.System.Collections
Assembly: UltimateXR (in UltimateXR.dll) Version: 0.0.0.0
Syntax
C#
public static List<T> Shuffled<T>(
this IReadOnlyList<T> self
)
Parameters
- self
- Type: System.Collections.Generic.IReadOnlyList<T>
List to get the random elements from
Type Parameters
- T
- Element type
Return Value
Type: List<T>
List with shuffled elements.
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type IReadOnlyList<T>. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
Remarks
Uses Unity’s random number generator (Range(Int32, Int32)).
See Also
Reference
ListExt Class
UltimateXR.Extensions.System.Collections Namespace