Skip to content

Commit

Permalink
[BundleEditorPlugin] Check if mesh has chunks before bundle editing (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
Ywingpilot2 authored Sep 17, 2023
1 parent 59bd449 commit e16de94
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions Plugins/BundleEditorPlugin/BundleEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,12 @@ public override void RemoveFromBundle(EbxAssetEntry entry, BundleEntry bentry)
{
foreach (MeshSetLod lod in meshSetRes.Lods)
{
ChunkAssetEntry chunkEntry = App.AssetManager.GetChunkEntry(lod.ChunkId);
chunkEntry.AddedBundles.Remove(App.AssetManager.GetBundleId(bentry));
resEntry.LinkAsset(chunkEntry);
if (lod.ChunkId != Guid.Empty)
{
ChunkAssetEntry chunkEntry = App.AssetManager.GetChunkEntry(lod.ChunkId);
chunkEntry.AddedBundles.Remove(App.AssetManager.GetBundleId(bentry));
resEntry.LinkAsset(chunkEntry);
}
}
}

Expand Down Expand Up @@ -260,9 +263,12 @@ public override void AddToBundle(EbxAssetEntry entry, BundleEntry bentry)
{
foreach (MeshSetLod lod in meshSetRes.Lods)
{
ChunkAssetEntry chunkEntry = App.AssetManager.GetChunkEntry(lod.ChunkId);
chunkEntry.AddToBundle(App.AssetManager.GetBundleId(bentry));
resEntry.LinkAsset(chunkEntry);
if (lod.ChunkId != Guid.Empty)
{
ChunkAssetEntry chunkEntry = App.AssetManager.GetChunkEntry(lod.ChunkId);
chunkEntry.AddToBundle(App.AssetManager.GetBundleId(bentry));
resEntry.LinkAsset(chunkEntry);
}
}
}

Expand Down

0 comments on commit e16de94

Please sign in to comment.