【m】资源拷贝修改
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using HybridCLR.Editor.Commands;
|
||||
@@ -47,16 +48,16 @@ namespace Stary.Evo.Editor
|
||||
#endif
|
||||
}
|
||||
|
||||
public static void OneShaderMark()
|
||||
public static void OneShaderMark(Action<string> complete)
|
||||
{
|
||||
OneShaderMark(GetOneKeyBuildEntities());
|
||||
OneShaderMark(GetOneKeyBuildEntities(),complete);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// (一键)收集shader【材质异常或资源修改】
|
||||
/// </summary>
|
||||
/// <param name="oneKeyBuildEntities"></param>
|
||||
public static void OneShaderMark(List<OneKeyBuildEntity> oneKeyBuildEntities)
|
||||
public static void OneShaderMark(List<OneKeyBuildEntity> oneKeyBuildEntities,Action<string> complete)
|
||||
{
|
||||
#if HotUpdate
|
||||
//标记全部资源
|
||||
@@ -65,7 +66,10 @@ namespace Stary.Evo.Editor
|
||||
if (oneKeyBUildEntity.isRaw)
|
||||
{
|
||||
MarkAdressable.CollectSvc(MarkAdressable.DomainRoot, oneKeyBUildEntity.DomainName,
|
||||
() => { EditorUtility.DisplayDialog("收集shader【材质异常或资源修改】", "收集成功", "确定"); });
|
||||
() =>
|
||||
{
|
||||
complete?.Invoke(oneKeyBUildEntity.DomainName);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -70,6 +70,7 @@ namespace Stary.Evo.Editor
|
||||
StreamingAssetsFilter.KeepFiles=new string[0];
|
||||
StreamingAssetsFilter.OnPreprocessBuild();
|
||||
}
|
||||
ShowNotification(new GUIContent("拷贝完成!"), 2f);
|
||||
}
|
||||
[ButtonGroup]
|
||||
[Button("$GetBuildAPKName", ButtonSizes.Large, ButtonStyle.FoldoutButton)]
|
||||
|
||||
@@ -44,7 +44,8 @@ public static class StreamingAssetsFilter
|
||||
// 移动到临时目录
|
||||
string backupPath = Path.Combine(tempBackupPath, relativePath);
|
||||
Directory.CreateDirectory(Path.GetDirectoryName(backupPath));
|
||||
File.Move(file, backupPath);
|
||||
File.Copy(file, backupPath,true);
|
||||
File.Delete(file);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -72,7 +73,12 @@ public static class StreamingAssetsFilter
|
||||
string relativePath = file.Replace(tempBackupPath + Path.DirectorySeparatorChar, "")
|
||||
.Replace(tempBackupPath, "");
|
||||
string originalPath = Path.Combine(streamingAssetsPath, relativePath);
|
||||
|
||||
// 检查目标文件是否已存在
|
||||
if (File.Exists(originalPath))
|
||||
{
|
||||
Debug.Log($"跳过恢复: {originalPath} (文件已存在)");
|
||||
return;
|
||||
}
|
||||
Directory.CreateDirectory(Path.GetDirectoryName(originalPath));
|
||||
File.Move(file, originalPath);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user