An assistant district attorney has been fatally shot as he walked toward his workplace at a North Texas county courthouse.