Summarize compile and run-time errors that unity beginners can easily commit (Part III)

Source: Internet
Author: User

Summarize compile and run-time errors that unity beginners can easily commit (Part III)


1:untiy A compilation error occurred: NewLine in Constant

650) this.width=650; "style=" float:left; "src=" http://s1.51cto.com/wyfs02/M02/86/D7/ Wkiom1fm5cfqtemdaabv66fa5rg452.png-wh_500x0-wm_3-wmp_4-s_3569173378.png "title=" 1.png "alt=" Wkiom1fm5cfqtemdaabv66fa5rg452.png-wh_50 "/>











Workaround:
Method One: If the error script is relatively small, you might use Notepad to open the error script, save As, or select UTF code overlay.

Method Two: Use Edit Plus to batch open all the scripts, and then batch modify the code, modified to Unicode, problem resolution.



2: How do you make a "blur" or "twist" lens effect in the game?

A: Import the unity lens effects post-processing package. Standard Assets-〉image Effects (pro only)



3:vs always quote the line endings in the following file is not consistent?


650) this.width=650; "Src=" Http://s1.51cto.com/wyfs02/M02/86/D6/wKioL1fM5ZXjvxrRAAAgRUNi_BE673.png-wh_500x0-wm_3 -wmp_4-s_510282724.png "title=" 1111.png "alt=" Wkiol1fm5zxjvxrraaagruni_be673.png-wh_50 "/>


Workaround:
(VS 2008/vs2012 tools->options->environment->documents).
Unchecked: Check for consistent line endings on load (see)


650) this.width=650; "Src=" Http://s1.51cto.com/wyfs02/M00/86/D7/wKiom1fM5biyBWZrAABkCzEDzHI297.png-wh_500x0-wm_3 -wmp_4-s_639736297.png "title=" 222222.png "alt=" Wkiom1fm5biybwzraabkczedzhi297.png-wh_50 "/>



4: How can I release the memory of Gameobject go?

For:

Use Resources.unloadunusedassets (). If you need to free memory immediately plus gc.collect (), memory may not be released immediately. However, it is recommended that resource.unloadunuseassets () be placed in an excessive scene between scenes to do better.
Otherwise, it will operate because of frequent GC. The phone will be blown away.


5: Miss Liu speaks of addcomponent (string) dynamic load script (using untiy4.x version) in your course, but I use unity5.3 version is not supported, how to deal with the problem of dynamic loading in unity5?

A: Use the following statement to resolve: Goneedobj.addcomponent (System.Type.GetType (strneedaddscriptname).


6:untiy5.3 above version Application.loadlevelasync is outdated which new method should I use?

Answer: Follow the prompts to modify:
UnityEngine.SceneManagement.SceneManager.LoadScene (""); Synchronous loading
UnityEngine.SceneManagement.SceneManager.LoadSceneAsync ("");//Asynchronous load


The above is the 2016 recent summary of some beginners more prone to error, for your reference.


This article is from "Teacher Liu Speak Unity" blog, please be sure to keep this source http://liuguozhu.blog.51cto.com/9142031/1846368

Summarize compile and run-time errors that unity beginners can easily commit (Part III)

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.