
Unity 2017 Game Optimization
By :

The SendMessage()
method and family of GameObject.Find()
methods are notoriously expensive and should be avoided at all costs. The SendMessage()
method is about 2,000 times slower than a simple function call, and the cost of the Find()
method scales very poorly with Scene complexity since it must iterate through every GameObject
in the Scene. It is sometimes forgivable to call Find()
during initialization of a Scene, such as during an Awake()
or Start()
callback. Even in this case, it should only be used to acquire objects that we know for certain already exist in the Scene and for scenes that have only a handful of GameObjects
in them. Regardless, using either of these methods for interobject communication at runtime is likely to generate a very noticeable overhead and potentially dropped frames.
Relying on Find()
and SendMessage()
is typically symptomatic of poor design, inexperience in programming with C# and Unity, or just plain laziness during...
Change the font size
Change margin width
Change background colour