码迷,mamicode.com
首页 > 其他好文 > 详细

优化建议

时间:2019-10-14 11:02:50      阅读:107      评论:0      收藏:0      [点我收藏+]

标签:object   update   ras   guide   find   already   mode   instant   loop   

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

优化建议

标签:object   update   ras   guide   find   already   mode   instant   loop   

原文地址:https://www.cnblogs.com/wayne1984/p/11669880.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!