1.
Resources資料夾裡的資源越多,程式的啟動畫面時間就越長。 链接
2.
Draw Call
Batching is only possible for objects that share the same material pointer.
Batching doesn't work on objects that have multiple materials.
Implicit state changes (e.g. lightmap index) can cause batching to end early.
3.
adb调试android
adb forward tcp:54999 localabstract:Unity-{insert bundle identifier here}
- Script Performance链接
Unity’s C# implementation is fast, and slowdown from script is usually the result of a mistake and/or an inadvertent block on slow external operations such as memory allocation. The Unity Profiler can help you find and fix these scripts.
Try to avoid foreach, lamda, and LINQ structures as these allocate memory needlessly at runtime. Use a for loop instead. Also, be wary of loops that concatenate strings.
GameObject creation and destruction takes time. If you have a lot of objects to create and destroy (say, several hundred in a frame), we recommend pooling them.
Don’t move colliders unless they have a rigidbody on them. Creating a rigidbody and setting isKinematic will stop physics from doing anything but will make that collider cheap to move. This is because Unity maintains two collider structures, a static tree and a dynamic tree, and the static tree has to be completely rebuilt every time any static object moves.
Note that coroutines execute in the main thread, and you can have multiple instances of the same coroutine running on the same script.
We recommend targeting around 1-2 ms maximum for all Mono execution time.
4.优化scrollRect