candidate: Gilligan cast Bryan Cranston for the role of Walter White based on having worked with him in a sixth season episode of the science fiction television series " The X-Files " , where Gilligan worked as a writer .