From 89dd6214d45463bec5336c314c97f4c90642d935 Mon Sep 17 00:00:00 2001 From: ALEXTANG <574809918@qq.com> Date: Mon, 9 Oct 2023 17:04:45 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=A6=96=E6=AC=A1=E5=9B=BE?= =?UTF-8?q?=E9=9B=86=E5=AF=BC=E5=85=A5bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复首次图集导入bug --- .../TEngine/Editor/Postprocessor/SpritePostprocessor.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/UnityProject/Assets/TEngine/Editor/Postprocessor/SpritePostprocessor.cs b/UnityProject/Assets/TEngine/Editor/Postprocessor/SpritePostprocessor.cs index ab9220b1..c93292ae 100644 --- a/UnityProject/Assets/TEngine/Editor/Postprocessor/SpritePostprocessor.cs +++ b/UnityProject/Assets/TEngine/Editor/Postprocessor/SpritePostprocessor.cs @@ -397,6 +397,10 @@ public static class EditorSpriteSaveInfo atlas.Add(spriteList.ToArray()); AssetDatabase.CreateAsset(atlas, path); + if (File.Exists(pathv2)) + { + AssetDatabase.DeleteAsset(pathv2); + } File.Move(path, pathv2); AssetDatabase.Refresh(); } @@ -413,6 +417,7 @@ public static class EditorSpriteSaveInfo Init(); List needSaveAtlas = new List(); m_tempAllASprites.Clear(); + m_allASprites.Clear(); var findAssets = AssetDatabase.FindAssets("t:sprite", new[] { UIAtlasPath }); foreach (var findAsset in findAssets) {