【Unity3d】配置文件与项目打包后资源获取

描述:
1.在Unity运行,资源正确正常加载。
2.打包之后,资源无法正确显示。

原因:
private readonly string mConfigPath = “Assets/StreamingAssets/Config.xml”;
对应运行时的目录结构,不对应打包之后的目录结构。

解决:
StreamingAssets文件夹下的东西会原封不动的打包。
private string mConfigPath;
void Awake()
{
mConfigPath = Application.streamingAssets + “Config.xml”;
}

猜你喜欢

转载自blog.csdn.net/itsxwz/article/details/80594334