Unidirectional magnetoresistance (UMR) is a magnetoresistance family that arises from spin-current generation in ferromagnet (FM)/nonmagnetic heavy metal (HM) bilayers. Because UMR exhibits asymmetric behavior owing to the current or external magnetic field directions, it is easy to quantify the amount of charge-to-spin conversion in a system and the sign of the spin current. UMR has been explained by two major mechanisms: spin accumulation at the FM/HM interface and electron-magnon scattering in an FM layer. In this study, we investigated the thickness and temperature dependence of the UMR of Ta/Co and Pt/Co bilayer structures and numerically analyzed the contribution of the electron-magnon scattering using a self-developed quantitative-analysis model. The magnon UMR was dominant in the Pt/Co samples, and the spin-accumulation-UMR and magnon-UMR trends were separated in the Ta/Co samples by thickness. The magnitude of the UMR strongly depends on the choice of the HM. Our findings provide a method to quantitatively separate the contributions of each mechanism.