Skip to content

Commit

Permalink
Merge pull request #86 from KisaragiEffective/perf/import-everything-…
Browse files Browse the repository at this point in the history
…at-once
  • Loading branch information
KisaragiEffective authored Sep 12, 2024
2 parents 99d182b + a8bd15c commit a676c0e
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions Editor/Transform/Environment/LilToon/LilToonHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,22 @@ internal void PerformInlineTransform(GameObject modifiableRoot)
return;
#endif
Profiler.BeginSample("LilToonHandler.PerformInlineTransform");
foreach (var renderer in GameObjectRecurseUtility.GetChildrenRecursive(modifiableRoot)
.Select(o =>
o.TryGetComponent(out SkinnedMeshRenderer smr) ? smr : null
).Where(o => o != null))
try
{
renderer.sharedMaterials = renderer.sharedMaterials.Select(RewriteInline).ToArray();
AssetDatabase.StartAssetEditing();
foreach (var renderer in GameObjectRecurseUtility.GetChildrenRecursive(modifiableRoot)
.Select(o =>
o.TryGetComponent(out SkinnedMeshRenderer smr) ? smr : null
).Where(o => o != null))
{
renderer.sharedMaterials = renderer.sharedMaterials.Select(RewriteInline).ToArray();
}
}
finally
{
AssetDatabase.StopAssetEditing();
}

Profiler.EndSample();
}

Expand Down

0 comments on commit a676c0e

Please sign in to comment.