// Callback function invoked when the cooldown timer is finished. private void CooldownFinished(float secondsOverflow) { // Choose a random attack. AttackHandler attack = UtilRandom.GetRandomElement(attacks); // Execute the attack. attack(boss); }
// Populates the grid of cubes. private void PopulateGrid() { // Clicking the wrong cube will take points away. Action <AppendixCube> cubeCallback = (x) => x.Clicked += WrongCubeClicked; // Instantiate the grid of cubes. cubes = UtilInstantiate.GridOfRectTransforms <AppendixCube>( Tuning.gridWidth, Tuning.gridHeight, prefabCube, true, gridContainer, 0.5f, cubeCallback); if (cubes.Count != 0) { // Choose a random cube and make it the Appendix. AppendixCube appendix = UtilRandom.GetRandomElement(cubes); appendix.MakeIntoAppendix(); // Clicking the appendix won't take points away. appendix.Clicked -= WrongCubeClicked; // Clicking the appendix will win the game. appendix.Clicked += WinGame; } }
public Sprite GetRandomElement() { return(UtilRandom.GetRandomElement(array)); }
// Returns a random element from the unclaimed list without removing it. public T GetRandomElementUnclaimed() { return(UtilRandom.GetRandomElement(unclaimed)); }
public Boss.Data GetRandomBoss() { return(UtilRandom.GetRandomElement(pool)); }
public AudioClip GetRandomElement() { return(UtilRandom.GetRandomElement(array)); }
public MusicChannelData GetRandomElement() { return(UtilRandom.GetRandomElement(array)); }
private AttackHandler GetRandomAttack() { return(UtilRandom.GetRandomElement(attacks)); }
public string GetRandomElement() { return(UtilRandom.GetRandomElement(array)); }