"I'm afraid few people can say it clearly." Series two: Special folders in Unity

Source: Internet
Author: User

Reference: http://www.manew.com/thread-99292-1-1.html
1. Hide Folders
Folders that begin with. are ignored. Resources in this folder will not be imported and the script will not be compiled. Also does not appear in Project view. We can find these files in the resource browser.

2. Standard Assets
The script in this folder is first compiled. Some of the resources built into unity are typically put together.
The scripts in this folder will be exported to Assembly-csharp-firstpass, Assembly-unityscript-firstpass or Assembly-boo-firstpass projects, depending on the language.
Official Document: Http://docs.unity3d.com/Documentation/Manual/ScriptCompileOrderFolders.html
The script in this folder is compiled first than any other script. Put the script in this folder, you can use C # script to access JavaScript scripts or other language scripts.

3. Pro Standard Assets

Same as standard assets, except that the files in it are for the pro version of Unity. Of course, it has more features, such as some advanced built-in shader files that only work in the pro version.

4. Editor

The folder named in Editor allows the script in it to access the API of Unity Editor. If a class or method in the Unityeditor namespace is used in the script, it must be placed in a folder named editor. Scripts in the Editor folder are not included in the build.
You can have multiple editor folders in your project. [Note: If you are in a normal folder, the Editor folder can be at any level of the directory.] If you are in a special folder, the Editor folder must be a direct subdirectory of the special folder. ]

5. Editor Default Resources

You can put some of the resources of the editor in here, than slices, text files, and so on. It will not be hit in the final release package as in the Editor folder, only for development use. You can read the resources in this folder directly through Editorguiutility.load, for example:
Textasset Text = editorguiutility.load ("1.txt") as Textasset;

6. Plugins

The plugins folder is used to put native plugins. They are automatically included in the build. Note This folder can only be a direct subdirectory of the assets folder.
For example: Windows:dll file;
Mac OS x:bundle file;
Linux under:. so files.
Like standard assets, the scripts here will compile earlier and allow them to be accessed outside the script.

6.0. plugins/x86 | | x86_64 (General PC platform)
If you create a game for a 32bit or 64bit platform, the native plugin file under this folder is automatically included in the game build. If this folder does not exist, unity will look for native pluglins under the Plugins folder.
If you are creating a universal build, it is recommended that you use both folders at the same time. Then put the 32bit and 64bit native plugins into the appropriate folder.
6.1. Plugins/android
Put the Java.jar file in this folder. The plugins. So file used in the Java language is also included.
Official Document: Http://docs.unity3d.com/Documentation/Manual/PluginsFor.html
6.2. Plugins/ios
In this folder put. O,. m,. mm,. C,. cpp, and so on, typically export the corresponding file on the iOS platform.
Official Document: Http://docs.unity3d.com/Documentation/Manual/PluginsForIOS.html

7. Resources
The resources folder allows you to access the resource through the file path and name in the script. The resources placed in this folder are always included in the build, even if it is not used. Because unity cannot tell if the script has access to its resources. You can have multiple resources folders in your project, so it is not recommended to place a resource with the same name in multiple folders. Once the build game is in place, all resources in the resource folder are packaged into the archive of the game's storage resources. In this way, the resources folder does not exist in the build of the game. Even though the script still uses the path of the resource in the project.
Official Document: Http://docs.unity3d.com/Documentation/Manual/LoadingResourcesatRuntime.html
Note: When a resource is accessed as a script variable, these resources are loaded into memory after the script is instantiated. If the resource is too large, you may not want it to be loaded like this. Then you can put these large resources into the resource folder and load them through resources.load. When these resources are no longer used, you can release the memory by destroy the object and then calling Resources.unloadunusedassets.
Characteristics:
(1). In-Folder resource packaging integration. Asset files, such as some shader/material/prefab resources files;
(2). The resources inside can only be read-only, can not be modified dynamically, the general Dynamic update resources are placed in this folder;
(3). Through the main line preempted;
(4). Resources.load (); Load resources
Resources.loadall (); Load all resources
Resources.loadasync (); Load Resources asynchronously

8. Gizmos
The Gizmos folder holds the map and icon resources used by the Gizmos.drawicon method. The map resource placed in the Gizmos folder can be used directly by name and can be drawn on the screen by editor as a gizmo. Here's The Ondrawgizmos () method, as long as the script inherits Monobehaviour, and it executes every frame in edit mode. The published game will certainly not be executed, it can only be used to draw small objects in the scene view. For example, to do a camera trajectory, it must be in the scene view to make a preview of the line, then with Gizmos.drawline and Gizmos.drawfrustum is better.

9. Webplayertemplates
The default Web page used to replace the Web build. None of the scripts in this folder will be compiled. This folder must be a direct subdirectory of the assets folder.

Ten. Streamingassets
The files here are copied to the build folder and are not modified (the mobile and web versions are different, they are embedded in the final build file). Their paths may vary by platform, but they can be accessed through Application.streamingassetspath.
For example: Some games in order to let all resources use Assetbundle, will put some initial assetbundle in Streamingassets directory, streamingassets directory of resources are not compressed, and it compared to the General Assembly space <ignore_js_op>

"I'm afraid few people can say it clearly." Series two: Special folders in Unity

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.