Skip to content

Commit a7c29a0

Browse files
committed
⭐[update] 测试配置是否生效
1 parent c67ef20 commit a7c29a0

File tree

4 files changed

+25
-13
lines changed

4 files changed

+25
-13
lines changed

Editor/Windows/Mode/Editor/AssetCollectWindow.OnDrawASConfig.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ partial void OnDrawASConfig()
3131
GELayout.Label("⇘", GEStyle.TEtoolbarbutton, GP_Width_20);
3232
if (GELayout.Button("Config", GEStyle.PreToolbar))
3333
{
34-
ViewSetting.IsShow = false;
34+
ViewConfig.IsShow = false;
3535
GUI.FocusControl(null);
3636
}
3737
}

Runtime/Basics/AssetSystem.Setting.cs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ public bool ExistsLocal()
105105
{
106106
return File.Exists(LOCAL_PATH);
107107
}
108-
108+
109109
/// <summary>
110110
/// 序列记录路径
111111
/// </summary>
@@ -117,9 +117,9 @@ public static string LOCAL_PATH
117117
#if UNITY_EDITOR
118118
Path.Combine(Application.dataPath.Substring(
119119
0, Application.dataPath.LastIndexOf('/')),
120-
"BuildinFiles");
120+
"Bundles", "Version");
121121
#else
122-
Path.Combine(Application.persistentDataPath, "BuildinFiles");
122+
Path.Combine(Application.persistentDataPath, "BuildinFiles", "Version");
123123
#endif
124124
if (!Directory.Exists(root)) Directory.CreateDirectory(root);
125125
return Path.Combine(root, FILE_NAME);
@@ -193,6 +193,7 @@ public Dictionary<string, List<AssetInfo>> ToYoo()
193193
{
194194
var info = YooAssets.GetPackage(record.PackageName).GetAssetInfo(record.Location);
195195
if (info is null) continue;
196+
if (!YooAssets.GetPackage(record.PackageName).IsNeedDownloadFromRemote(info)) continue;
196197
if (!list.ContainsKey(record.PackageName)) list.Add(record.PackageName, new List<AssetInfo>());
197198
if (list[record.PackageName].Contains(info)) continue;
198199
list[record.PackageName].Add(info);
@@ -261,6 +262,12 @@ public static implicit operator AssetInfo(SequenceRecord record)
261262
return YooAssets.GetPackage(record.PackageName).GetAssetInfo(record.Location);
262263
}
263264
#endif
265+
266+
public override string ToString()
267+
{
268+
return
269+
$"[{Time}] {PackageName} - {Location} - {AssetPath} - {Bytes.ToConverseStringFileSize()} - {Count}";
270+
}
264271
}
265272
}
266273
}

Runtime/Proxy.YooAsset/Extensions/Event/Loading.cs

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -169,16 +169,20 @@ internal static DownloaderOperation CreateDownloaderOperation(YAssetPackage pack
169169
AssetSystem.Parameter.LoadingMaxTimeSlice,
170170
AssetSystem.Parameter.DownloadFailedTryAgain,
171171
AssetSystem.Parameter.Timeout);
172-
var record = new AssetSystem.SequenceRecord
172+
if (AssetSystem.Parameter.EnableSequenceRecord)
173173
{
174-
PackageName = package.PackageName,
175-
Location = location.Address,
176-
Time = DateTime.Now,
177-
Bytes = operation.TotalDownloadBytes,
178-
Count = operation.TotalDownloadCount,
179-
AssetPath = location.AssetPath,
180-
};
181-
AssetSystem.AddSequenceRecord(record);
174+
var record = new AssetSystem.SequenceRecord
175+
{
176+
PackageName = package.PackageName,
177+
Location = location.Address,
178+
Time = DateTime.Now,
179+
Bytes = operation.TotalDownloadBytes,
180+
Count = operation.TotalDownloadCount,
181+
AssetPath = location.AssetPath,
182+
};
183+
Console.WriteLine(record);
184+
AssetSystem.AddSequenceRecord(record);
185+
}
182186
LoadHandle.RegisterEvent(location, operation);
183187
return operation;
184188
}

Runtime/Proxy.YooAsset/YAssetProxy.Downloader.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,7 @@ private void DownloadRecordBegin(AssetSystem.SequenceRecordQueue queue)
323323

324324
foreach (var pair in queue.ToYoo())
325325
{
326+
AssetSystem.Log($"创建序列下载器,准备下载更新当前资源版本所有的资源包文件 [{pair.Key}]");
326327
var name = pair.Key;
327328
var assetInfos = pair.Value.ToArray();
328329
var operation = YAssetSystem.CreateBundleDownloader(pair.Key, assetInfos,

0 commit comments

Comments
 (0)