With the rapid development of computational power and parallel algorithms, Monte Carlo method has been widely investigated and used in neutron transport simulations due to its advantages in geometry modelling and usage of continuous energy point-wise cross sections. Monte Carlo codes can also be coupled with thermal-hydraulics codes to consider feedbacks. One of the most important aspects of thermal-hydraulics feedback is the detailed temperature distribution, which results in the demands of updates of temperature dependent cross sections in neutron transport simulations. For thermal reactors such as PWR and HTGR, two neutron energy regions should be carefully considered: the resolved resonance region (RRR) and the thermal energy region, especially the resolved resonance region. Besides, the temperature dependence of cross sections in the unresolved resonance energy region (URR) is also important for fast reactors and some experimental critical assemblies. In this paper, the on-the-fly temperature treatment of cross sections in the RRR was implemented in RMC code. The on-the-fly method for the URR was also proposed and implemented in RMC code, which was also combined with the on-the-fly temperature treatments for resolved resonance energy. The proposed method was applied to Monte Carlo transport and depletion calculations. The accuracy and efficiency are compared for different combinations of methods of RRR and URR. The results show that the on-the-fly treatment has high efficiency and satisfactory fidelity. The probability tables with equiprobable bands were also developed to reduce the memory consumption, with keeping the same accuracy of original probability tables.