Unity 5在经过若干Beta、RC版迭代之后,千呼万唤始出来,对于需要从Unity 4.x切换到Unity 5的用户来说,一些已有的认识需要调整,这些内容包括但不限于:
1. Moving static colliders does not cause performance penalty anymore. 在Unity 5之前,移动一个静态的collider会存在可观的性能损耗,但在Unity 5中,这个问题已经被解决。
2. In Unity5 we also cache the transform component on the c# side, so there should no longer be a performance reason to cache the transform component yourself. 在Unity 5之前,直接引用transform会有较大的性能开销,所以一般的做法是在组件的Start或Awake方法中缓存一下这个transform,现在Unity 5已经帮我们做了这个事情,所以程序员不需要再额外对transform进行缓存。
3. Removed quick property accessors, like .rigidBody, .rigidbody2D, .camera, .light, .animation, .constantForce, .renderer, .audio, .networkView, .guiTexture, .collider, .collider2D, .particleSystem, .particleEmitter, .guiText, .hingeJoint for modularization. Instead, use GetComponent to get references.由于Unity 5采用模块化思想对底层进行了重写,原来定义的一些便利属性访问器被取消。旧工程升级时可以参考http://blogs.unity3d.com/2014/06/23/unity5-api-changes-automatic-script-updating/ 。
4. In Unity 5.0, we have a new AssetBundle build system which is much more easier to use than the old one. Unity 5引入了新的AssetBundle打包系统,相较于之前的版本,使用更方便,具体参见http://docs.unity3d.com/Manual/BuildingAssetBundles5x.html