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)