Today, I heard an interesting advice from my friend. He said that :
u don't call GameObject.transform.position in Monobehavior.Update() ,
because GameObject.transform equals Transform trans = GameObject.GetComponent<Transform>() ;
so that would cause low effeciency ... then he show me lots of example in NGUI code ...
And he told me to cache a GameObject.transform reference at the very beginning..
I really doubt that, can any one explain that ?
thanks a lot.
u don't call GameObject.transform.position in Monobehavior.Update() ,
because GameObject.transform equals Transform trans = GameObject.GetComponent<Transform>() ;
so that would cause low effeciency ... then he show me lots of example in NGUI code ...
And he told me to cache a GameObject.transform reference at the very beginning..
I really doubt that, can any one explain that ?
thanks a lot.