Tasharen Entertainment Forum
Support => NGUI 3 Support => Topic started by: N3uRo on October 27, 2014, 02:27:43 PM
-
Aren can you fix this? I mean change all the "shortcuts" of Monobehaviour to "GetComponent<T>()".
And you can get rid of mTrans because they say that internally they cache transform component.
Thanks!!
http://unity3d.com/unity/beta/5.0
-
+1, would love to see this in the next update.
-
Changing whatever shortcuts are used should be a simple change, but removing cachedTransform will likely slow things down for everything but 5.0 where it doesn't cache properly and performs a getcomponent every time.
-
Changing whatever shortcuts are used should be a simple change, but removing cachedTransform will likely slow things down for everything but 5.0 where it doesn't cache properly and performs a getcomponent every time.
In "SCRIPTING FEATURES"
"“transform” is now cached on the C# side, no more need to cache it yourself."
http://unity3d.com/unity/beta/5.0/release-notes
-
In "SCRIPTING FEATURES"
"“transform” is now cached on the C# side, no more need to cache it yourself."
http://unity3d.com/unity/beta/5.0/release-notes
That's exactly his point, performance for everyone but 5.0 users will degrade if that change will be done right now.
-
Unity 5 will automatically rewrite references to .particleSystem, .collider, etc to the GetComponent<T> version when you upgrade your project. That won't help when you need to update to a new version of NGUI though (if NGUI is still using .collider). I would say Aren should run his NGUI project through a Unity 5 upgrade now (since GetComponent<Collider>() is no worse than .collider) but leave the caching of transforms until Unity 5.1 or a time when the majority of users are on Unity 5.
-
Why not just use both approaches and wrap the code with platform dependent compilation macros like... #if UNITY_5_0
It will be a little ugly but it should work.
-
After you import the NGUI's update, Unity 5 will automatically auto-upgrade everything for you. I've made NGUI Unity 5 compatible more than a month ago.
-
After you import the NGUI's update, Unity 5 will automatically auto-upgrade everything for you. I've made NGUI Unity 5 compatible more than a month ago.
And everytime we want to start a new project we have to import NGUI and "auto upgrade"?? That doesn't make any sense.
There could be places in NGUI where you use some "shortcut" in Update/LateUpdate/FixedUpdate and it's going to replace it to "GetComponent<T>()" and it's not being cached with "mComponent = GetComponent<T>()" in Awake/Start