刚刚调试时无意中留意到这个问题, 于是开了一个空白工程做这个测试:
在两个空的埸景之间, 只在onLoad时用cc.director.loadScene()来回切换到两个埸景;
但时间越久, 两个埸景的切换时间就越来越长, 请问是甚么原因?
2019-11-19T04:09:15.476Z - normal: Simulator: D/jswrapper (130): JS: Cocos Creator v2.2.0
2019-11-19T04:09:18.603Z - normal: Simulator: D/jswrapper (130): JS: LoadScene 4bb2da40-769a-4e8b-9d47-3316a26b2129: 16.235999999999876ms
2019-11-19T04:09:18.896Z - normal: Simulator: D/jswrapper (130): JS: LoadScene 2e5cfe78-0641-4734-9438-636872d4851a: 156.53600000000006ms
2019-11-19T04:09:19.143Z - normal: Simulator: D/jswrapper (130): JS: LoadScene 4bb2da40-769a-4e8b-9d47-3316a26b2129: 239.52400000000034ms
2019-11-19T04:09:19.613Z - normal: Simulator: D/jswrapper (130): JS: LoadScene 2e5cfe78-0641-4734-9438-636872d4851a: 230.82999999999993ms
2019-11-19T04:09:19.699Z - normal: Simulator: D/jswrapper (130): JS: LoadScene 4bb2da40-769a-4e8b-9d47-3316a26b2129: 210.96900000000005ms
2019-11-19T04:09:19.953Z - normal: Simulator: D/jswrapper (130): JS: LoadScene 2e5cfe78-0641-4734-9438-636872d4851a: 129.65200000000004ms
2019-11-19T04:09:20.088Z - normal: Simulator: D/jswrapper (130): JS: LoadScene 4bb2da40-769a-4e8b-9d47-3316a26b2129: 128.07399999999961ms
2019-11-19T04:09:20.476Z - normal: Simulator: D/jswrapper (130): JS: LoadScene 2e5cfe78-0641-4734-9438-636872d4851a: 187.71799999999985ms
.
.
.
2019-11-19T05:09:42.061Z - normal: Simulator: D/jswrapper (130): JS: LoadScene 4bb2da40-769a-4e8b-9d47-3316a26b2129: 1644.4560000002384ms
2019-11-19T05:09:43.050Z - normal: Simulator: D/jswrapper (130): JS: LoadScene 2e5cfe78-0641-4734-9438-636872d4851a: 291.0240000002086ms
2019-11-19T05:09:46.187Z - normal: Simulator: D/jswrapper (130): JS: LoadScene 4bb2da40-769a-4e8b-9d47-3316a26b2129: 1929.1820000000298ms
2019-11-19T05:09:47.064Z - normal: Simulator: D/jswrapper (130): JS: LoadScene 2e5cfe78-0641-4734-9438-636872d4851a: 354.69399999966845ms
2019-11-19T05:09:50.193Z - normal: Simulator: D/jswrapper (130): JS: LoadScene 4bb2da40-769a-4e8b-9d47-3316a26b2129: 1910.5550000001676ms
2019-11-19T05:09:51.093Z - normal: Simulator: D/jswrapper (130): JS: LoadScene 2e5cfe78-0641-4734-9438-636872d4851a: 513.6680000000633ms
2019-11-19T05:09:54.007Z - normal: Simulator: D/jswrapper (130): JS: LoadScene 4bb2da40-769a-4e8b-9d47-3316a26b2129: 1851.7280000001192ms
2019-11-19T05:09:54.650Z - normal: Simulator: D/jswrapper (130): JS: LoadScene 2e5cfe78-0641-4734-9438-636872d4851a: 255.41299999970943ms