这里路径pc端是在StreamingAssets下
//不同平台下StreamingAssets的路径是不同的,这里需要注意一下。
public static readonly string PathURL =
#if UNITY_ANDROID
"jar:file://" + Application.dataPath + "!/assets/";
#elif UNITY_IPHONE
Application.dataPath + "/Raw/";
#elif UNITY_STANDALONE_OSX || UNITY_EDITOR_OSX
"file://" + Application.dataPath + "/StreamingAssets/";
#elif UNITY_STANDALONE_WIN || UNITY_EDITOR
Application.dataPath + "/StreamingAssets/";
#else
string.Empty;
#endif
本文介绍了在Unity中根据不同平台正确配置StreamingAssets路径的方法。针对Android、iOS、Mac及Windows等平台,给出了具体的路径设置代码示例。

被折叠的 条评论
为什么被折叠?



