Skip to content

Commit cf9b09b

Browse files
committed
fixed sync refresh issue
1 parent 3add6c7 commit cf9b09b

File tree

5 files changed

+33
-3
lines changed

5 files changed

+33
-3
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Changelog (unofficial)
22

3+
## [1.5.1] - 2022-08-29
4+
- Fixed when enabled sync has refresh issue (do refresh all or refresh specific).
5+
36
## [1.5.0] - 2022-08-29
47
- Added Sync feature for BuildMap. When drag a bundle to BuildMap can sync to specified BuildMap.
58
- Added namespace AssetBundleBrowser.AssetBundleDataSource for BundleBuildMap class.

Editor/AssetBundleBrowserMain.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -472,6 +472,17 @@ public static void ReloadBuildMapDataSource()
472472
{
473473
if (typeof(BundleBuildMap).IsInstanceOfType(AssetBundleModel.Model.DataSource))
474474
{
475+
// sync to specified buildMap
476+
if ((AssetBundleModel.Model.DataSource as BundleBuildMap).enableBundleSync)
477+
{
478+
foreach (var bundleSyncMap in (AssetBundleModel.Model.DataSource as BundleBuildMap).bundleSyncMaps.ToArray())
479+
{
480+
if (!bundleSyncMap.sync || bundleSyncMap.bundleBuildMap == null) continue;
481+
bundleSyncMap.bundleBuildMap.RefreshAllAssetBundle();
482+
}
483+
}
484+
485+
// last refresh current data source
475486
(AssetBundleModel.Model.DataSource as BundleBuildMap).RefreshAllAssetBundle();
476487
}
477488
}

Editor/BundleBuildMap.cs

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ private BuildBundleInfo _GetBuildBundleInfoByBundleNameWithSimilarAssetPath(stri
192192
if (samples.Count > 0)
193193
{
194194
decimal max = samples.Keys.Max();
195-
Debug.Log($"<color=#FFE733>BundleName: {bundleName},</color> <color=#FF9933>Most Similar ({(max * 100).ToString("f2")}%) => Replace</color> <color=#33D6FF>old AssetPath: {samples[max].assetPath}</color> <color=#FF9933>to</color> <color=#A4FF33>new AssetPath:{tAssetPath}</color>");
195+
Debug.Log($"<color=#FF1FF9>DataSourceName: {this.sourceName},</color> <color=#FFE733>BundleName: {bundleName},</color> <color=#FF9933>Most Similar ({(max * 100).ToString("f2")}%) => Replace</color> <color=#33D6FF>old AssetPath: {samples[max].assetPath}</color> <color=#FF9933>to</color> <color=#A4FF33>new AssetPath:{tAssetPath}</color>");
196196
return samples[max];
197197
}
198198

@@ -387,7 +387,21 @@ internal void RefreshAllAssetBundle(IEnumerable<BundleInfo> bundles)
387387
}
388388
}
389389

390-
if (bundleNames.Count > 0) this.RefreshAllAssetBundle(bundleNames.ToArray());
390+
if (bundleNames.Count > 0)
391+
{
392+
// sync to specified buildMap
393+
if (this.enableBundleSync)
394+
{
395+
foreach (var bundleSyncMap in this.bundleSyncMaps.ToArray())
396+
{
397+
if (!bundleSyncMap.sync || bundleSyncMap.bundleBuildMap == null) continue;
398+
bundleSyncMap.bundleBuildMap.RefreshAllAssetBundle(bundleNames.ToArray());
399+
}
400+
}
401+
402+
// last refresh current data source
403+
this.RefreshAllAssetBundle(bundleNames.ToArray());
404+
}
391405
}
392406

393407
public CustomBuildMap[] GetCustomBuildMaps()

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ When switch data source if has exclamation mark messages you can right-click on
3737

3838
### Sync Bundle To Specified BuildMap
3939

40+
When enabled sync feature, recommend refresh specific a bundle instead of refresh all.
41+
4042
![](https://github.com/michael811125/AssetBundles-Browser-Plus/blob/master/Documentation/images/desc_img_8.gif)
4143

4244
# Installation

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
{
33
"name": "com.unity.assetbundlebrowser.plus",
44
"displayName": "Asset Bundle Browser Plus",
5-
"version": "1.5.0",
5+
"version": "1.5.1",
66
"unity": "2018.1",
77
"description": "The Asset Bundle Browser tool enables the user to view and edit the configuration of asset bundles for their Unity project. It will block editing that would create invalid bundles, and inform you of any issues with existing bundles. It also provides basic build functionality.\n\nUse this tool as an alternative to selecting assets and setting their asset bundle manually in the inspector. It can be dropped into any Unity project with a version of 5.6 or greater. It will create a new menu item in Window > AssetBundle Browser. The bundle configuration, build functionality, and built-bundle inspection are split into three tabs within the new window.",
88
"keywords": ["asset", "bundle", "bundles", "assetbundles"],

0 commit comments

Comments
 (0)