Here is a list of all the special folders used in the development of the shot tour.
1.Editor
The Editor folder can be in the root directory, or in subdirectories, as long as the name of the editor can be called. For example directory:/xxx/xxx/editor and/editor are the same, no matter how many folders called Editor can be. All resource files or script files placed under editor will not be punched into the release package, and scripts can only be used when editing. In general, the script for some tool classes is placed here, or some of the DLLs used for editing. For example, if we were to do a similar skill editor, then the editor's code would be nice to put here, because we would only need the editor-generated files for the actual runtime, without the need for the editor's core code.
2.Editor Default Resources
Editor Default resources Note that there are spaces in the middle, which must be placed at the root of Project view, which is not possible if you want to place the/xxx/xxx/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.
12 |
textasset text = editorguiutilityload ( "test.txt" as textasset debug. Log (text. Text |
3.Gizmos
I don't think this folder is really useful, as the following code shows it can draw an icon for a coordinate in the scene view. It has the advantage of being able to pass a Vecotor3 as a picture display position. Parameter 2 is the name of the picture, of course, this picture must be placed under the Gizmos folder.
123 |
void ondrawgizmos ( { Gizmos drawicon (transform position, "0.png" Span class= "Crayon-sy" >, true) } |
If you just want to hang on a game object, then you can set it directly inside the INSPECOTR.
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.
4.Plugins
If you do mobile game development General Andoird or iOS to pick up some SDK can put the SDK dependent library files here, such as. so. jar. a file. This will automatically put the files in your bag after the package is finished.
5.Resources
Can be in the root directory, can also be in a subdirectory, as long as the name of the resources can be called. For example directory:/xxx/xxx/resources and/resources are the same, no matter how many folders called Resources can be. Resources folder resource Whether you use it or not, it will be packaged into. apk or. IPA
Resource.load: Both edit and run time can be read directly by Resource.load.
Resources.loadassetatpath (): It can read the resources under any folder in the Assets directory, it can be used at the time of editing or when the editor is running, but it cannot be used on the real machine, its path is "assets/xx/xx.xxx" This must be the path, with the suffix name of the file.
Assetdatabase.loadassetatpath (): It can read resources under any folder in the assets directory, which is only available for editing. Its path is "assets/xx/xx.xxx" must be this path, and with the suffix name of the file.
I think in the development of the computer as far as possible to use Resource.load () or Resources.loadassetatpath (), if the phone to select a portion of the resources to play assetbundle, a portion of the resources resource.load (). So when doing. apk or. IPA is now automatically packaged with a script, you can use Assetdatabase.moveasset () to move the original files that have been packaged into Assetbundle from the resources folder before packaging, This way, the running package will not wrap up the extra files. After you finish the package, move the folder back.
6. Streamingassets
The resources under this folder are also packaged in. apk or. IPA the difference between it and the resources is that the resource will compress the file, but it will not compress the package in its entirety. And it is a read-only folder, that is, the program can only read and write when it is running. It has different paths under each platform, but you can use Application.streamingassetspath to select the corresponding path based on the current platform.
Some games in order to let all the resources use Assetbundle, will put some initial assetbundle in the Streamingassets directory, Run the program when you copy these assetbundle in the Application.persistentdatapath directory, if these assetbundle are updated, then download to the new assetbundle in the Application.persisten Tdatapath the original cover out of the directory.
Because the Application.persistentdatapath directory is the application's sandbox directory, there is no such directory before packaging until the application is installed on the phone.
Streamingassets directory resources are not compressed, so it compared to the General Assembly space, such as your application installed on the phone will occupy 100M of capacity, then you put a 100M assetbundle in Streamingassets, Then at this time on the mobile phone will be in the capacity of 200M.
We are here today, if you have any questions welcome to the discussion with the @ Yu song Momo. Hey.
Unity3d all special folders in the development of the Hand tour