File tree Expand file tree Collapse file tree 2 files changed +6
-10
lines changed Expand file tree Collapse file tree 2 files changed +6
-10
lines changed Original file line number Diff line number Diff line change @@ -180,14 +180,14 @@ private void UpdateResource()
180
180
foreach ( var item in _remoteVersion . Resources )
181
181
{
182
182
//本地有响应文件则跳过
183
- if ( _localVersion . Resources . Contains ( item ) )
183
+ if ( _localVersion != null && _localVersion . Resources != null && _localVersion . Resources . Contains ( item ) )
184
184
continue ;
185
185
string remoteUrl = Path . Combine ( GameMode . Resource . ResUpdatePath , item . Name ) ;
186
186
//获取本地文件的路径
187
187
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 ) ;
191
191
if ( ! Directory . Exists ( localDir ) )
192
192
Directory . CreateDirectory ( localDir ) ;
193
193
Original file line number Diff line number Diff line change @@ -67,11 +67,7 @@ public string LocalPath
67
67
return "" ;
68
68
}
69
69
}
70
-
71
- /// <summary>
72
- /// ab资源默认包名称
73
- /// </summary>
74
- public string RootAssetBundle = "AssetBundles/AssetBundles" ;
70
+
75
71
/// 资源更新的路径
76
72
/// </summary>
77
73
public string ResUpdatePath = "" ;
@@ -113,7 +109,7 @@ public void SetResourceHelper(IResourceHelper resourceHelper)
113
109
/// <param name="mainfestName"></param>
114
110
public void SetMainfestAssetBundle ( string mainfestName , bool isEncrypt = false )
115
111
{
116
- _resourceHelper ? . SetResourcePath ( LocalPathType , RootAssetBundle , isEncrypt ) ;
112
+ _resourceHelper ? . SetResourcePath ( LocalPathType , mainfestName , isEncrypt ) ;
117
113
}
118
114
119
115
/// <summary>
You can’t perform that action at this time.
0 commit comments