Quick Post: Repeat

public static void Repeat(this int value, Action callback)
{
	for (int i = 0; i < value; i++)
	{
		callback();
	}
}
 
...
 
10.Repeat(DoStuff);
 
...
 
Random.Range(10, 20).Repeat(CreateDoodad);

Leave a Reply