【m】修复每次编译后拷贝打包资源需要点两下才生效的问题

This commit is contained in:
mzh
2026-03-31 18:00:16 +08:00
parent a42a663ad2
commit 0ee46115fc
2 changed files with 12 additions and 4 deletions

View File

@@ -14,11 +14,18 @@ public static class StreamingAssetsFilter
public static int callbackOrder => 0; // 执行优先级
// 要删除的文件后缀列表
private const string extensionsToDelete = ".meta";
private static void TryInit()
{
if(string.IsNullOrEmpty(streamingAssetsPath))
streamingAssetsPath = Application.dataPath + "/StreamingAssets";
if(string.IsNullOrEmpty(tempBackupPath))
tempBackupPath = Application.dataPath + "/../StreamingAssets_Backup";
}
public static void OnPreprocessBuild()
{
streamingAssetsPath = Application.dataPath + "/StreamingAssets";
tempBackupPath = Application.dataPath + "/../StreamingAssets_Backup";
TryInit();
if (!Directory.Exists(streamingAssetsPath)) return;
@@ -55,6 +62,7 @@ public static class StreamingAssetsFilter
public static void OnPostprocessBuild()
{
TryInit();
if (!Directory.Exists(tempBackupPath)) return;

View File

@@ -1,6 +1,6 @@
{
"name": "com.staryevo.tools",
"version": "1.3.35",
"version": "1.3.36",
"displayName": "00.StaryEvo.Tools",
"description": "This is an Framework package(后台服务器版本端口9527)",
"unity": "2021.3",