Skip to content

Commit f31c23b

Browse files
committed
Merge branch 'master' into ILRuntime
2 parents edda126 + 2ca9dec commit f31c23b

File tree

2 files changed

+6
-10
lines changed

2 files changed

+6
-10
lines changed

Assets/Game/Scripts/State/CheckResourceState.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -180,14 +180,14 @@ private void UpdateResource()
180180
foreach (var item in _remoteVersion.Resources)
181181
{
182182
//本地有响应文件则跳过
183-
if (_localVersion.Resources.Contains(item))
183+
if (_localVersion!=null&& _localVersion.Resources!=null&&_localVersion.Resources.Contains(item))
184184
continue;
185185
string remoteUrl = Path.Combine(GameMode.Resource.ResUpdatePath, item.Name);
186186
//获取本地文件的路径
187187
string localPath = Path.Combine(GameMode.Resource.LocalPath, item.Name);
188-
//创建文件夹
189-
int index = localPath.LastIndexOf("/", StringComparison.Ordinal);
190-
string localDir = localPath.Substring(0, index);
188+
189+
//创建文件夹
190+
string localDir = Path.GetDirectoryName(localPath);
191191
if (!Directory.Exists(localDir))
192192
Directory.CreateDirectory(localDir);
193193

Assets/GameFramework/Resource/ResourceManager.cs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,7 @@ public string LocalPath
6767
return "";
6868
}
6969
}
70-
71-
/// <summary>
72-
/// ab资源默认包名称
73-
/// </summary>
74-
public string RootAssetBundle = "AssetBundles/AssetBundles";
70+
7571
/// 资源更新的路径
7672
/// </summary>
7773
public string ResUpdatePath="";
@@ -113,7 +109,7 @@ public void SetResourceHelper(IResourceHelper resourceHelper)
113109
/// <param name="mainfestName"></param>
114110
public void SetMainfestAssetBundle(string mainfestName, bool isEncrypt = false)
115111
{
116-
_resourceHelper?.SetResourcePath(LocalPathType, RootAssetBundle, isEncrypt);
112+
_resourceHelper?.SetResourcePath(LocalPathType, mainfestName, isEncrypt);
117113
}
118114

119115
/// <summary>

0 commit comments

Comments
 (0)