Mel Gibson co-wrote Apocalypto .
In 2006 he wrote , directed and produced Apocalypto , an epic adventure film set in Mesoamerica depicting the final days of the Mayan civilization before Spanish arrival in the 16th century .
Mel Gibson filmography