Starting Animation from random time frame Unity
Code snippet to start the animation at different time. Useful when there are many same animation running on screen and you want to make them random.
Code snippet to start the animation at different time. Useful when there are many same animation running on screen and you want to make them random.
private T[] ShuffleArray<T>(T[] array) {
System.Random r = new System.Random ();
for(int i = array.Length; i > 0; i--) {
int j = r.Next (i);
T k = array [j];
array [j] = array [i - 1];
array [i - 1] = k;
}
return array;
}