提交 fd6374b6 编写于 作者: T tanghai

1.读取ios StreamingAssets中的文件需要加file:// 安卓却不需要加

2.用AssetBundle.LoadFromFile读取StreamingAssets的ab包都不需要加file://
上级 9e74c3ec
......@@ -31,5 +31,21 @@ namespace ETModel
return Application.streamingAssetsPath;
}
}
/// <summary>
/// 应用程序内部资源路径存放路径(www/webrequest专用)
/// </summary>
public static string AppResPath4Web
{
get
{
#if UNITY_IOS
return $"file://{Application.streamingAssetsPath}";
#else
return Application.streamingAssetsPath;
#endif
}
}
}
}
......@@ -56,7 +56,7 @@ namespace ETModel
}
else
{
versionPath = Path.Combine(PathHelper.AppResPath, "Version.txt");
versionPath = Path.Combine(PathHelper.AppResPath4Web, "Version.txt");
using (UnityWebRequestAsync request = ComponentFactory.Create<UnityWebRequestAsync>())
{
await request.DownloadAsync(versionPath);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册