
Unity 2017 Game Optimization
By :

The Transform
Component stores data only relative to its own parent. This means that accessing and modifying a Transform
Component's position
, rotation
, and/or scale
properties can potentially result in a lot of unanticipated matrix multiplication calculations to generate the correct Transform
representation for the object through its parent Transforms
. The deeper the object is in the Hierarchy
window, the more calculations are needed to determine the final result.
However, this also means that using localPosition
, localRotation
, and localScale
have a relatively trivial cost associated with them, since these are the values stored directly in the given Transform
and can be retrieved without any additional matrix multiplication. Therefore, these local property values should be used whenever possible.
Unfortunately, changing our mathematical calculations from world-space to local-space can over-complicate what were originally simple (and solved) problems, so...
Change the font size
Change margin width
Change background colour