Two of the compression mode: Lzma (the default), Lz4
Four kinds of loading method:
1, is loaded from memory: LoadfromMemory () memory
2, loaded from a local: LoadFromFile
3, loading from a local or www server (mentioned below)
4, is loaded from the server unityWebRequest
Load dependent resource bundle
1, the overall configuration dependent (streamingAssets)
2, find all depend on target to load the resources by name
3, load all dependent resources
Lua Lua script plus a suffix file format to bytes
Resource Path:
Application.datapath;
Application.streamingAssetsPath (read-only can not write)
Application.persistentDataPats (special read and write when running!)
Application.temporarycachePath
1, Windows.manifest (total configuration file)
Dependencies: things to a complete show, must be another thing.
2, a single configuration file Assetbundle package: which is recorded
(1) a single resource inside Assetbundle
(2) recording the dependence of the individual Asssetbundle
Dependence bundle package is loaded:
(Wit ha figure by way of example as I)
The first one:
A loading what needs doing that?
1, B and C loading
2. A load
Uninstall A?
1, uninstall B, C dependencies
2, B is determined, whether there is dependent on C B, C uninstall
the second:
Load A?
1, A is determined dependency relationship determination B, C | B, C Analyzing D
Uninstall B?
1, can only uninstall B, D relationship
Uninstall C?
1, uninstall C, D relationship
2, unloading D
Insert a small topic
Reference count:
Gc mechanism is also present relationship reference count: whom references (List <>) who cited (List <>)
The following are three memory storage and the packet bundle loading
1, bundle pack is loaded on a network using WWW and loaded into local, bundle packages load (memory image) by the local method Assetbundle.LoadFromFile
Release memory: Assetbundle.Unload (false)
2,解压Assetbundle:Assetbundle.Load()将镜像里的zip包解压出来
释放内存:Resource.Unloadasset(obj)只能卸载obj类型 shader 网格 材质 贴图都不能卸载 而Resource.Unloadunusedasset()用这个API释放 shader 网格 材质 贴图
3,GameObjece.instance使用解压出来的资释
释放内存:Destroy()