- Unity 2017 Game Optimization(Second Edition)
- Chris Dickinson
- 240字
- 2021-07-02 23:21:04
Verifying script count
If we’re looking at our Profiler data and note that a certain MonoBehaviour method is being executed more times than expected, or is taking longer than expected, we might want to double-check that it only occurs as many times in the Scene as we expect it to. It’s entirely possible that someone created the object more times than expected in the Scene file, or that we accidentally instantiated the object more than the expected number of times from code. If so, the problem could be due to conflicting or duplicated method invocations generating a performance bottleneck. We can verify the count using the same shortlist method used in the Best approaches to performance analysis section.
If we expected a specific number of Components to appear in the Scene, but the shortlist revealed more (or less!) than this, then it might be wise to write some initialization code that prevents this from ever happening again. We could also write some custom Editor helpers to display warnings to any level designers who might be making this mistake.
Preventing casual mistakes such as this is essential for good productivity, since experience tells us that if we don't explicitly disallow something, then someone, somewhere, at some point, for whatever reason, will do it anyway. This is likely to cost us a frustrating afternoon hunting down a problem that eventually turned out to be caused by human-error.
- Clojure Programming Cookbook
- Visual Basic 6.0程序設計計算機組裝與維修
- NLTK基礎教程:用NLTK和Python庫構建機器學習應用
- 看透JavaScript:原理、方法與實踐
- Python Geospatial Development(Second Edition)
- UI智能化與前端智能化:工程技術、實現方法與編程思想
- INSTANT Django 1.5 Application Development Starter
- Mastering Apache Maven 3
- Getting Started with LLVM Core Libraries
- 單片機C語言程序設計實訓100例
- Babylon.js Essentials
- HTML5權威指南
- Image Processing with ImageJ
- PHP 7從零基礎到項目實戰
- Kubernetes進階實戰