/// <summary> /// Function adds block with given position and block type into the terrain data and generates mesh. /// </summary> /// <param name="position"></param> /// <param name="blockType"></param> public void PlaceBlock(Vector3 position, BlockType blockType) { allBlocks[position] = blockType; playerBlocks[position] = blockType; StartCoroutine(GenerateMesh(overwrite: true, atOnce: true)); gdController.PlaceBlock(transform.position, position, blockType); }