SteamingAssets目录下的文件读取规则注意事项

StreamingAssets下面的文件读取有一些规则还是得注意一下,有点记忆偏差就会出事。

1. StreamingAssets目录直接用Application.streamingAssetsPath获取就行;

2. AssetBundle.LoadFromFile可以读取StreamingAssets下的AssetBundle;

3. Windows & ios平台,用C# File类是可以读取普通文件的;

4. Android平台,用C# File类不可以读取普通文件,这个一定要注意,原因看官方文档

    https://docs.unity3d.com/Manual/StreamingAssets.html

    On Android, the files are contained within a compressed .jar file (which is essentially the same format as standard zip-compressed files). This means that if you do not use Unity’s WWW class to retrieve the file, you need to use additional software to see inside the .jar archive and obtain the file. 

    Android平台可以用WWW读取。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值