//spawn the tetramino at the location of the spawner private void spawnpiece(int n) { GameObject tetramino = (GameObject)Instantiate(Tetrominoes[n], transform.position, Quaternion.identity); TetrisBlock currentPiece = tetramino.GetComponent(typeof(TetrisBlock)) as TetrisBlock; if (!currentPiece.ValidMove()) { currentPiece.reset(); Application.LoadLevel(1); } }