From 03abac082ce4b035fe3e7c661e6b6d1f5899840b Mon Sep 17 00:00:00 2001 From: hevinci Date: Thu, 2 Feb 2023 10:05:20 +0800 Subject: [PATCH] update shader variant collector --- .../Editor/ShaderVariantCollector/ShaderVariantCollector.cs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Assets/YooAsset/Editor/ShaderVariantCollector/ShaderVariantCollector.cs b/Assets/YooAsset/Editor/ShaderVariantCollector/ShaderVariantCollector.cs index 3d23197..bdc683e 100644 --- a/Assets/YooAsset/Editor/ShaderVariantCollector/ShaderVariantCollector.cs +++ b/Assets/YooAsset/Editor/ShaderVariantCollector/ShaderVariantCollector.cs @@ -231,14 +231,12 @@ namespace YooAsset.Editor { foreach(var go in _allSpheres) { - var mat = go.GetComponent().sharedMaterial; - Resources.UnloadAsset(mat); GameObject.DestroyImmediate(go); } _allSpheres.Clear(); // 尝试释放编辑器加载的资源 - Resources.UnloadUnusedAssets(); + EditorUtility.UnloadUnusedAssetsImmediate(); } private static void CreateManifest() {