描述:
1.在Unity运行,资源正确正常加载。
2.打包之后,资源无法正确显示。
原因:
private readonly string mConfigPath = “Assets/StreamingAssets/Config.xml”;
对应运行时的目录结构,不对应打包之后的目录结构。
解决:
StreamingAssets文件夹下的东西会原封不动的打包。
private string mConfigPath;
void Awake()
{
mConfigPath = Application.streamingAssets + “Config.xml”;
}
ps:要使用相对路径,不能写死!