Optimization tips and tricks
The Stats panel and the Profiler are solid tools for diagnosing performance problems in your game, as well as determining where those problems are in the script, thereby suggesting how they may be corrected. However, as mentioned, optimization should begin at the design phase of development, and should persist throughout all subsequent stages. Consequently, there are some general tips, tricks, and workflows that can be followed, with proper consideration and limitations, to help optimize your game across development, minimizing problems that could emerge later. This section explores some of these tips and tricks, in addition to those already mentioned in Chapter 1, Preparation and Asset-Configuring. Let's see these...
Strings and comparisons
Working with strings in Unity is common. Game objects have names and tags, animations have parameters, and games feature many other string properties, including names, localization data, character dialogue, and more. Consequently...