当前位置:网站首页>Special folders in unity3d and their meanings
Special folders in unity3d and their meanings
2022-06-30 04:53:00 【LintonL】
1.Editor
Editor The folder can be in the root directory , It can also be in subdirectories , Just call it Editor Can . For example, catalog :/xxx/xxx/Editor and /Editor It's the same , No matter how many are called Editor Any folder in the library can .Editor All resource files or script files placed below will not be typed into the release package , And scripts can only be used when editing . Generally, some tool class scripts are placed here , Or some of them for editing DLL. For example, we are now going to make a similar skill editor , So it's better to put the editor's code here , Because we only need the files generated by the editor when we actually run , Without the core code of the editor .
2.Editor Default Resources
Editor Default Resources Notice that there are spaces in the middle , It has to be placed in Project In the root of the view , If you want to put it /xxx/xxx/Editor Default Resources This is not going to work . You can put some resources used by the editor here , Such as the picture 、 text file 、 wait . It and Editor No folder will be typed into the final release package , Only for development use . You can go straight through EditorGUIUtility.Load To read the resources in this folder .
1 2 | TextAssettext=EditorGUIUtility.Load("test.txt")asTextAsset; Debug.Log(text.text); |
3.Gizmos
I don't think this folder is really useful , As shown in the following code, it can be used in Scene In the view, draw a for a certain coordinate icon. Its advantage is that it can be passed on Vecotor3 As the location of the picture . Parameters 2 Is the name of the picture , Of course, this picture must be placed in Gizmos Under the folder .
1 2 3 | voidOnDrawGizmos(){ Gizmos.DrawIcon(transform.position,"0.png",true); } |
If you just want to hang on to a game object , So in Inspecotr You can set it directly ..
Here I still want to talk about OnDrawGizmos() Method , As long as the script inherits MonoBehaviour after , And it will be executed every frame in edit mode . The released game will not be executed , It can only be used in scene Draw some small objects in the view . For example, we need to make camera tracks , So it must be in Scene Make a preview line in the view , Then use Gizmos.DrawLine and Gizmos.DrawFrustum No better .
4.Plugins
If you do mobile game development in general andoird perhaps iOS To pick up some sdk You can put sdk Dependent library files Put it here , such as .so .jar .a file . In this way, after typing the package, you will automatically type these documents in your package .
5.Resources
It can be in the root directory , It can also be in subdirectories , Just call it Resources Can . For example, catalog :/xxx/xxx/Resources and /Resources It's the same , No matter how many are called Resources Any folder in the library can .Resources The resources in the folder will be packed in no matter whether you use them or not .apk perhaps .ipa
Resource.Load : Both edit time and run time are available through Resource.Load To read directly .
Resources.LoadAssetAtPath() : It can read Assets Resources in any folder under the directory , It can be used when editing or when the editor is running , But it can't be used on a real machine , Its path is ”Assets/xx/xx.xxx” It has to be this path , And with the suffix of the file .
AssetDatabase.LoadAssetAtPath(): It can read Assets Resources in any folder under the directory , It can only be used in editing . Its path is ”Assets/xx/xx.xxx” It has to be this path , And with the suffix of the file .
I think we should try to use it when developing on the computer Resource.Load() perhaps Resources.LoadAssetAtPath() , If you choose some resources on your mobile phone, you need to call assetbundle, Some resources Resource.Load(). So what are you doing .apk perhaps .ipa When Now, it is all automated packaging with scripts , Before packing It can be used AssetDatabase.MoveAsset() Pack it into assetbundle The original file from Resources Move out under the folder and pack , In this way, the printed operation package will not contain redundant files . After packing, move the moved folder back .
6. StreamingAssets
The resources in this folder will also be packaged in .apk perhaps .ipa It and Resources Is the difference between the ,Resources Will compress the file , But it won't be compressed and packed intact . And it's a read-only folder , That is, the program can only read Can't write . It has different paths under different platforms , But you can use Application.streamingAssetsPath It will choose the corresponding path according to the current platform .
Some games use all their resources assetbundle, Will put some initial assetbundle Put it in StreamingAssets Under the table of contents , When running the program, put these assetbundle Copy in Application.persistentDataPath Under the table of contents , If these assetbundle If there is an update , Then download to the new assetbundle In the Application.persistentDataPath Overwrite the original directory .
because Application.persistentDataPath The directory is the sandbox directory of the application , So there is no such directory before packaging , This directory is not available until the application is installed on the phone .
StreamingAssets The resources in the directory are uncompressed , So it takes up more space , For example, your application installed on your mobile phone will take up 100M The capacity of , So you're... Again StreamingAssets Put a 100M Of assetbundle, Then it will be installed on the mobile phone at this time 200M The capacity of .
7. Hide Folder
With .( spot ) The beginning of the folder will be Unity Ignore . Resources in this kind of folder will not be imported , Scripts don't compile . It won't show up in Project In the view .
8.WebPlayerTemplates
To replace web build The default page of . None of the scripts in this folder will be compiled . This folder must be used as Assets Direct subdirectories of folders .
边栏推荐
- 【Paper】2015_ Active fault-tolerant control system design with trajectory re-planning against actuator
- Solution to the 292 week match of Li Kou
- Unity automatic pathfinding
- pycharm 数据库工具
- Unity3d lookat parameter description
- Recommended cultural landmarks of these tourist attractions in Bangkok
- Unity download and installation website
- Approaching history, introduction to the London Guard Museum
- How to renew an SSL certificate
- Unity is associated with vs. there is a compiler problem when opening
猜你喜欢

MySQL query gadget (I) replace a property value of the object in the JSON array in the JSON format string field

【Paper】2017_ Distributed control for high-speed trains movements

Singapore parent-child tour, these popular attractions must be arranged

Solution to Autowired annotation warning

力扣59. 螺旋矩阵 II
![[UAV] kinematic analysis from single propeller to four rotor UAV](/img/32/1a88b102f832ffbbc1a7e57798260a.jpg)
[UAV] kinematic analysis from single propeller to four rotor UAV

Deep learning ----- different methods to realize inception-10

Approaching history, introduction to the London Guard Museum

Unity lens making

Sectigo certificate
随机推荐
Lambda&Stream
【Paper】2015_ Coordinated cruise control for high-speed train movements based on a multi-agent model
Connect to the database and run node JS running database shows that the database is missing
One interview question every day to talk about the process of TCP connection and disconnection
Implementation of one interview question one distributed lock every day
SCM learning notes: interrupt learning
深度学习------不同方法实现Inception-10
力扣59. 螺旋矩阵 II
One interview question and one joint index every day
MySQL查询小工具(一)json格式的字符串字段中,替换json数组中对象的某个属性值
Bean creation process and lazy init delay loading mechanism
PBR material: basic principle and simple fabrication
Unity is associated with vs. there is a compiler problem when opening
Foreign SSL certificate
為什麼win10開熱點後電腦沒有網絡?
Unreal 4 learning notes - Animated Montage
Singapore parent-child tour, these popular attractions must be arranged
Moore Manor diary I: realize the reclamation, sowing, watering and harvest in Moore Manor
SSL update method
Sailing experience not to be missed in New York Tourism: take you to enjoy the magnificent city scenery from different perspectives