Esempio n. 1
0
        // 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);
        }
Esempio n. 2
0
    // 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;
        }
    }
Esempio n. 3
0
 public Sprite GetRandomElement()
 {
     return(UtilRandom.GetRandomElement(array));
 }
Esempio n. 4
0
 // Returns a random element from the unclaimed list without removing it.
 public T GetRandomElementUnclaimed()
 {
     return(UtilRandom.GetRandomElement(unclaimed));
 }
Esempio n. 5
0
 public Boss.Data GetRandomBoss()
 {
     return(UtilRandom.GetRandomElement(pool));
 }
Esempio n. 6
0
 public AudioClip GetRandomElement()
 {
     return(UtilRandom.GetRandomElement(array));
 }
Esempio n. 7
0
 public MusicChannelData GetRandomElement()
 {
     return(UtilRandom.GetRandomElement(array));
 }
Esempio n. 8
0
 private AttackHandler GetRandomAttack()
 {
     return(UtilRandom.GetRandomElement(attacks));
 }
Esempio n. 9
0
 public string GetRandomElement()
 {
     return(UtilRandom.GetRandomElement(array));
 }