
Unity 5 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 reasonable to call Find()
during initialization of a Scene, such as Awake()
and Start()
, only for objects that already exists in the Scene. However, using either method for inter-object communication at runtime is likely to generate a very noticeable overhead.
Relying on Find()
and SendMessage()
type methods is typically symptomatic of poor design, inexperience in programming with C# and Unity, or just plain laziness during prototyping. Their usage has become something of an epidemic among beginner- and intermediate-level projects, such that Unity Technologies feels the need to...
Change the font size
Change margin width
Change background colour