优化建议

Posted wayne1984

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了优化建议相关的知识,希望对你有一定的参考价值。

We have established some guidelines for 3D games to reduce crashes and optimize performances, please have a look and make sure to follow above ones. Let me know if you have any questions.

1) MOST IMPORTANT: Use the Unity Profiler to know what is causing the framerate to drop
2) Make sure every rendered object is a prefab (it‘s especially important for sprites with alpha)
3) If using Physics 2D, make sure any changes to RigidBodies are done in FixedUpdate, it‘s very important
4) If using Physics 2D and RigidBodies, make sure to limit Continuous Collision to a main character/element, everything else must be Discrete (Not sure if applies here but still)
5) Graphics Settings V-Sync should be set to Every V-Blank
6) Before you build an android .apk, go to Android Player Settings -> Other Settings, and untick Auto Graphics API, only add OpenGLES2 and do not use 3 nor even add it
7) Unoptimized Shaders could be an issue, that‘s what caused some framerate drop on another published game
8) Don‘t use big Texture files when possible
9) Occlusion Culling could help if there are too many offscreen elements rendered
10) Use pools of game objects, avoid destroy/create loops and reuse already instantiated game objects when possible
11) Be careful with GameObject.Find<>() and never use it in any Update nor FixedUpdate loop, it butchers performance drastically. Prefer static references if you need to access a GameObject during updates
12) HQ Realtime Shadows may greatly affect performances
13) 3D Models with a lot of Vertices may affect performances
14) Reflective and Transparent shaders may affect performances prefer to use Diffuse shader available in Unity when possible instead

以上是关于优化建议的主要内容,如果未能解决你的问题,请参考以下文章

数据库优化篇—— SQL语句优化建议

数据库优化篇—— SQL语句优化建议

CC++代码优化的一些建议

Unity 几种优化建议

MySQL 调优/优化的 100 个建议

7000字前端性能优化总结 | 干货建议收藏