Unity 5 beta overview. Migration to new Unity version
Several days ago “Unity 5 beta 1” was leaked to the web. And I think that it is time to start migration of my game project to new Unity version.
Changes
Full list of changes in Unity 5Unity provide you a tool for updating your code. This would be an error message about updating the code and you need to click it. But it doesn’t help me a lot.
- User GetComponent() instead of quick property. For javascript use GetComponent.<>()
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 GetComponentThis will force you to change a lot of legacy code because it was more fast and useful to user short property instead of GetComponent, but Unity decided to drop it for modularization reasons.to get references.
“transform” is now cached on the C# side, no more need to cache it yourself. And GetComponent performance was improved. Good news. For better performance we usually cache transform value because access transform was the same as GetComponent(), but this operation was heavy.
Method and fields changes SetTriangles instead SetTriangleStrip orthographic instead isOrthographic (camera property) “offset” instead of “center” property for BoxCollider2D
External SDK
NGUI
Works fine. You need manual change code according to changes I've mentioned.Also don’t forget to change this lines of defines
#if !UNITY_3_5 && !UNITY_4_0 && !UNITY_4_1 && !UNITY_4_2 && !UNITY_4_3 && !UNITY_4_4 && !UNITY_4_5
Photon Cloud (PUN Plugin)
Also works fine but I had a problem with Ping class when try to build for Web GL. So just change Unityengine.Ping class to C#using System.Net.NetworkInformation;
...
System.Net.NetworkInformation.Ping ping = new System.Net.NetworkInformation.Ping();
System.Net.NetworkInformation.PingOptions options = new System.Net.NetworkInformation.PingOptions ();
options.DontFragment = true;
PingReply reply = ping.Send (regionIp);
while (reply.Status != IPStatus.Success/*!ping.isDone && Time.time < startTime + timeout*/)
{
// sometimes Unity ping never returns, so we use a timeout here
yield return 0;
}App42 Cloud
Crash on user login. Somewhere inside the lib. I've already send crash report to Shephertz.HTML5 support (WebGL build)
Unity 5 build targetsNew define UNITY_WEBGL added.
After making all porting stuff I was not able to compile my project to HTML5. I have got an error messages:
Recursive Serialization is not supported. You can’t dereference a PPtr while loading
Fatal error in Mono CIL Linker
Failed to resolve System.Collections.Hashtable UnityEngine.WWWForm::get_headers()
Angly Bots demo was compiled normally for HTML5. Compilation take match more time than for web player.
