Beispiel #1
0
    private void endFalling()
    {
        removeFromInputEvents();
        foreach (var tile in tetrominoTiles)
        {
            tile.endFalling();
        }

        spawner.spawn();
        Destroy(transform.GetChild(0).gameObject); //Rotation colliders
        Destroy(GetComponent <Rigidbody>());
        Destroy(this);
    }
Beispiel #2
0
    private void endFalling()
    {
        removeFromInputEvents();
        int maxRow = 0;

        for (int i = 0; i < tetrominoTiles.Length; i++)
        {
            tetrominoTiles[i].endFalling();
            if (tetrominoTiles[i].position.y > maxRow)
            {
                maxRow = tetrominoTiles[i].position.y;
            }
        }
        arena.checkRows(maxRow);
        spawner.spawn();
        Destroy(transform.GetChild(0).gameObject); //Rotation colliders
        Destroy(GetComponent <Rigidbody>());
        Destroy(this);
    }
Beispiel #3
0
 private void startGame()
 {
     spawner.spawn();
     gameObject.SetActive(false);
 }