
Unity 5 Game Optimization
By :

When we create new MonoBehaviour
script files in Unity, whether we're using Unity 4 or Unity 5, it creates two boilerplate methods for us:
// Use this for initialization void Start () { } // Update is called once per frame void Update () { }
The Unity engine hooks in to these methods during initialization and adds them to a list of methods to call back at key moments. However, if we leave these as empty declarations in our codebase, then they will cost us a small overhead whenever the engine invokes them.
The Start()
method is only called when the GameObject is instantiated for the first time, which can be whenever the scene is loaded or a new GameObject is instantiated from a Prefab. Therefore, leaving the empty Start()
declaration may not be particularly noticeable unless there's a lot of GameObjects in the scene invoking them at startup time. However, it also adds unnecessary overhead to any GameObject.Instantiate()
call, which typically happens during...
Change the font size
Change margin width
Change background colour