private void SpawnNewBlock() { // Everytime one block is dead the ground ten new block will be created if (block.isBlockDead == true) { end_pos_y = newBlock.transform.position.y; // If Block's start_pos_y is equal to its end pos_y then we know that player has lost the game if (start_pos_y == end_pos_y) { ActiveGame.GameOver(); game_over_menu.SetActive(true); } newBlock = listOfPrefabs.GetOnePrefab(); newBlock = Instantiate(newBlock, transform.position, newBlock.transform.rotation); block = newBlock.GetComponent <Block>(); block.fallingRate = block_falling_rate; block.deathRate = block_death_rate; blockInput.buttonsBlocked = false; blockInput.buttonLeftBlocked = false; blockInput.buttonRightBlocked = false; blockInput.buttonRotateBlocked = false; blockInput.buttonFastDropBlocked = false; setBlockMaterial(); // Setting color of the new block rowManager.RefreshRows(); // Refreshing every hot spot on the map } }