你的代码中最贵的调用就是这个。
The expensive call on your code is this one:
sg.Initialize(false)。
这将从骨架文件(.json
或.skel.bytes
)中加载一切。
This loads everything from the skeleton file (.json
or .skel.bytes
).
如果我没有记错的话,你在发给我们的复制包中使用了.json
。这对加载时间非常不利。请将任何生产资产导出为.skel.bytes
二进制文件,因为它们更小,加载速度更快。
If I remember correctly, you used .json
in a reproduction package that you sent us. This is very bad for load times. Please export any production assets as .skel.bytes
binary files, as they are smaller and load much faster.
关于预加载:你可以在执行其他预加载时调用上面的方法来预加载数据。只是在帧率很重要的时候不要调用它。
Regarding preloading: you can call the methods above to pre-load the data when you perform your other pre-loading. Just don't call it when the framerate matters.