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读取。

你可能感兴趣的:(unity3d)