[Tip] Coroutine Optimization Technique
Unity3D/Tips / 2016. 10. 7. 16:59
Optimization Technique :
Let’s take an example, and see why and where we can optimise. Below Coroutine just waits for the 0.5 sec and then call your desired method.
But every time you call this method “new WaitForSeconds(0.5f)” will allocate memory for the new object, which is not good.
Instead, we should save its reference in Start, and use it when it is required, In this way, we will not allocate memory on every call.
Never use “yield return 0“, instead of that use “yield return null”
반응형
'Unity3D > Tips' 카테고리의 다른 글
[펌] 유니티 최적화 Tips (0) | 2016.10.26 |
---|---|
[펌] 유니티 SendMessage 사용의 장점 (0) | 2016.10.26 |
[펌] 에디터에서 게임 플레이를 할 때 저장되지 않은 Assets 저장하기 (0) | 2016.09.30 |
Latest Optimization Initiative for Unity Games (0) | 2016.09.18 |
[펌] Audio Clip (0) | 2016.09.07 |