当前位置:网站首页>Small knowledge points of asset
Small knowledge points of asset
2022-06-23 02:04:00 【Thunder Gazi】
1. Wavy lines
When the end of the folder is ~. He will not display in the project .


2.DisableWriteTypeTree Use
Unity In order to make the new version compatible with the old version Assetbundle, Complete settings will be made when packaging . For example, the previous version recorded a lot of data, but the new version was not used .. When the new version is packaged, the data will still be written in by default , Let the old version also work . therefore bundle It will be a little bigger

It uses a very simple Cube package , Generated with the first Bundle yes 39KB. The second is 26KB. Their memory usage at run time is also very different . So if the project is sure not to change the version for development and use DisableWriteTypeTree Packaging reduces package size and memory usage . The author has also experienced 6、7 It's a project , At present, there is no project that has been online, and a new version should be used unity Iterative development .
3. When the same resource is loaded asynchronously and synchronously in the project , The practice of our project is to synchronize directly in asynchrony load To solve .
4.Unity Why is it that setting resources in a project does not change the properties of the file itself , The reason is that the import project will generate a copy of the resources in Library in .Unity Reading is actually Library Resources for .
There was a problem in the previous project , It is wrong to import a shader into a new device no matter how you change it . Later, I took other people's Library Just copy the resource .
5. Officials say that if you want to do a hot update in the project , Many of them are generated AssetBundle In the process of MD5 The record of . This can sometimes be wrong , Maybe two identical files have different versions , Generated MD5 Are not the same as . Recommended in build AssetBundle Go ahead MD5 Record , Or lazy Just use the generated AssetBundle There are Hash Value to record .
6. When there is a sound in the project, the large sound delay in the real machine is likely due to the DSP buff The setting is too large . His principle is that the trigger sound will be added to the cache and wait , Wait until the buffer is large enough to play . This reduces communication with the sound card , But the problem is as mentioned above .
7. If our code writes multiple generics Such as <T,U,X,Z> And so on. , Be sure to pay attention to constraints . Because his implementation will generate a stack of permutation overloads at compile time , Suppose the coefficient of a term is 10 individual , that 4 Item will appear 1000 One such overload . That's pretty efficient .
8.Resource Don't put too many resources in it , Because a non uninstallable red black tree will be generated inside , So as to occupy memory .
9. Official recommendation LZ4 compression technique , The speed is almost Lzma Of 10 times , But the compressed volume will be higher than 30%,trunk-base Compression mode of , When decompressing, you can reduce the memory consumption , Because there is no need to unzip the entire file , Unzip each trunk When , You can reuse buffer( In the China enhanced version, a LZ4 Of AssetBundle encryption )
10.Texture
1.upload buffer
and DSP buffer similar , Is how much to fill Texture Data time , towards GPU push once
2.r/w
Do not open it if it is not necessary , One Texture The normal loading process is
Load into memory -> analysis -> upload buffer -> From memory delete
After the option is turned on , Not from memory delete, As a result, both memory and video memory have a copy ( notes : Looks like iOS There won't be two , Instead, use a virtual pointer , Point to the same piece of data , The details can be verified )
3.mip maps
for example UI Don't open these , Also reduces memory footprint
11. We use Unity It made me feel Unity The memory you eat won't spit out . It actually spits out , But the conditions are hardly met , want 6 Time GC You will not return until you have accessed it . Therefore, in the project, it is still calculated as if you can't spit out after eating . Because its memory structure is not compact , So the sequence of loading and unloading resources is very important .
For example, I now uninstall 2 individual 5MB Resources for , It is not continuous in the memory area , At this time, I want to load a 8MB Resources for . I'm sorry , this 2 individual 5MB Can not meet this condition , So an extra one will be created 8MB To store this resource , This leads to waste .
But if the memory area is unloaded at this time 10MB Resources for , So this 8MB Our resources will be crammed in . There is no extra waste .
In view of this , Projects can first unload resources that occupy a large amount of memory , Then load small resources instead of vice versa .
12. About closures and anonymous functions , During the operation period, there will be new A new object comes out , Do not release until the object is released . Cause some unexpected waste .
边栏推荐
- 11. function template, class template, implementation vector sequence container, and space adapter
- //1.9 char character variable operation
- Single chip microcomputer (STC series 8051 core single chip microcomputer)
- Application and challenge of ten billion level map data in Kwai security intelligence
- Score and loop statements (including goto statements) -part3
- Spread spectrum and frequency hopping
- 【CodeWars】 Pete, the baker
- Freshman C language summary post (hold change) Part 2 formatted monthly calendar
- 165. cat climbing
- JS rotation chart (Netease cloud rotation chart)
猜你喜欢

Three methods for solving Fibonacci sequence feibonacci (seeking rabbit) - program design

Interviewer: why does TCP shake hands three times and break up four times? Most people can't answer!

C language games: sanziqi (simple version) implementation explanation

Circuit analysis (circuit principle)

Do you know the memory components of MySQL InnoDB?

Google account cannot be logged in & external links cannot be opened automatically & words with words cannot be used

Rebirth -- millimeter wave radar and some things I have to say

Anaconda creates a new environment encounter pit

fatal: refusing to merge unrelated histories

1. Mx6u bare metal program (2) - Lighting master (imitating 32 register version)
随机推荐
"Initial C language" (Part 1)
1. Mx6u bare metal program (6) - timer
Analog Electronic Technology
Hello
Nuxt - auto generate dynamic route bug
On function overloading from several examples
7.new, delete, OOP, this pointer
Single chip microcomputer (STC series 8051 core single chip microcomputer)
//1.11 basic operators
Deep learning environment configuration (I) installation of CUDA and cudnn
Component development
[cmake command notes]target_ compile_ options
Exercise analysis summary
1. introduction to MySQL database connection pool function technology points
Questions not written in the monthly contest
How are pub and sub connected in ros1?
//1.16 getchar function
//1.13 auto increment and auto decrement operators (+ +, --)
4. functions and inline functions with default values for formal parameters
2022-1-14