Unity4 update to Unity5 Update note, unity4unity5

Source: Internet
Author: User

Unity4 update to Unity5 Update note, unity4unity5

For a Bug, the game project was upgraded from Unity4.6 to Unity5 for testing. There were some problems in the middle. Note.


(1) usage changes of Plugin

In Unity5.0, each imported DLL, SO, and Jar file that looks like a plug-in file has an option to set its function platform. When Unity4.6 is upgraded to Unity5.0, some files cannot be correctly judged on the Platform, and are set to all on the Platform option. The following error occurs.

We only need to find the corresponding file and set the platform for its function to solve this BUG.


If the DLL file is not a Plugin file, deselect the Platform check box.


(2) The AddComponent (string) interface is discarded.

Update from Unity4.6 to Unity5.0. After opening the project, Unity automatically detects the code and converts the code to the new API. AddComponent (string) is converted to the following format.

addedComponent = UnityEngineInternal.APIUpdaterRuntimeServices.AddComponent(go, "Assets/PlayMaker/Actions/AddComponent.cs (56,21)", component.Value);

It works normally in the UnityEditor environment, but an error is returned when exporting the Xcode project:

Assets/PlayMaker/Actions/AddComponent.cs(56,88): error CS0619: `UnityEngineInternal.APIUpdaterRuntimeServices.AddComponent(UnityEngine.GameObject, string, string)' is obsolete: `Method is not meant to be used at runtime. Please, replace this call with GameObject.AddComponent<T>()/GameObject.AddComponent(Type).'

That is to say, this API is obsolete, and now only AddComponent (T) can be used.

Therefore, the System. Type. GetType (string) is used to obtain the Type, and then in AddComponet.

However, this may cause problems in IL2CPP, because IL2CPP will crop the code, so AOT compilation may cause a BUG that the type cannot be found during runtime.

If this happens, the previous article provides a solution:

http://blog.csdn.net/huutu/article/details/43986079





Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.