当前位置:网站首页>Unity 基础 之 目录结构解析
Unity 基础 之 目录结构解析
2022-07-16 09:55:00 【陈言必行】
Unity 基础 之 目录结构解析
一,Unity的资源数据加载
Resources
- 打包集成到.asset文件里面及引用的资源as后se一个文件里面面
- 主线程加载
- 想要动态更新资源则不考虑
AssetBundle
- unity定义的二进制文件类型
- 用WWW类下载
StreamingAssets
- 可读不可写
- 内容限制 - 无
- 只能用WWW类下载
PersistentDataPath
- 可读可写
- 内容限制 - 无
- 清除手机缓存文件会一并清理这里的东西
- 随意弄,可作为本地目录让WWW下载、也可以自己用FileInfo乱整
Resources的序列化
当项目被构建时,所有名为Resources的文件夹中的所有Asset和Object都会合并到同一个序列化文件中。这个序列化文件中还含有元数据(Metadata)和索引(Indexing)信息,类似于AssetBundle。正如AssetBundle文档中所描述的那样,这个索引中包含了一个用于将给定Object名称转换为恰当的File GUID和Local ID的序列化查找树,同时它也用于定位在序列化文件中偏移了指定字节数的Object。
在大多数平台上,用于查找的数据结构是平衡查找树,其时间复杂度为O(nlog(n))。因此,索引加载时间随Resources文件夹内Object数量而增长的速度高于线性增长。
Resource、StreamingAsset文件夹安装后的路径(Android,iOS)
StreamingAsset
- iOS : Application.dataPath + /Raw
- Android : jar:file:// + Application.dataPath + !/assets/
Resources
- 打包成一个Asset文件
二,Unity的Android和IOS上相关的目录结构
Android:
- assets 游戏内容相关的都在这里了
- lib JNI相关的东西
- META-INF Java包跟rar包的区别
- res 图标之类的
- AndroidManifest.xml Android配置文件
- classes.dex Java虚拟机runtime的东西
- resources.arsc Java编译后的二进制文件
IOS:
- level0/level1… Scene
- sharedassets0/shaedassets1/… Scene相关的东西
- Managed 脚本编译后的dll
- resources.assets Resources里面的东西
- Raw StreamingAssets里面的东西
三,常用目录对应的Android,iOS平台地址
IOS:
- Application.dataPath : Application/xxxxx/xxx.app/Data
- Application.streamingAssetsPath : Application/xxxxx/xxx.app/Data/Raw
- Application.persistentDataPath : Application/xxxxx/Documents
- Application.temporaryCachePath : Application/xxxxx/Library/Caches
Android:
- Application.dataPath : /data/app/xxx.xxx.xxx.apk
- Application.streamingAssetsPath : jar:file:///data/app/xxx.xxx.xxx.apk/!/assets
- Application.persistentDataPath : /data/data/xxx.xxx.xxx/files
- Application.temporaryCachePath : /data/data/xxx.xxx.xxx/cache
边栏推荐
- Advanced Mathematics -- Chapter 8 partial derivatives and total derivatives of implicit functions
- 剑指 Offer II 041. 滑动窗口的平均值
- 【今天的小go同学要去丢垃圾(2)】
- 精度提升方法:自适应Tokens的高效视觉Transformer框架(已开源)
- 模拟功放75610诊断功能的调试
- Block的底层实现
- 数据库每日一题---第24天:格式化部门表
- ValueError: The number of FixedLocator locations (7), usually from a call to set_ ticks, does not mat
- Talk about promise
- Exceptions to the administrative punishment law
猜你喜欢
随机推荐
The difference between query string, formdata and request payload
暑假第二周
The merits and demerits of cefi in the perspective of liquidity
Irregular area of OSPF
[today's little go is going to throw away the garbage (2)]
Hcip - ppp/hdlc and gre/mgre experiments
LeetCode腾讯精选练习50题-054.螺旋矩阵
Atcoder beginer contest 259 partial solution
C# 串口与TCP客户端 STTech.BytesIO
Big model training is difficult to go to the sky? Here comes the efficient and easy-to-use "Li Bai" model library
OSPF的5个数据包、LSA信息
Learning notes - DC motor governor
总结:Prometheus匹配模式
数据库与开源的未来
PG operation and maintenance -- error log and slow log
速来围观,17个运维实用技巧 ~
想通讯?谈钱多俗,谈ProtoBuf
[vsctf2022]web topic recurrence
脱敏项目的苦乐得失
mysql进阶(四)聊聊mysql中的事务锁机制









