The relative trace formula approach to the global Gan-Gross-Prasad conjecture for unitary groups