【m】资源拷贝修改
This commit is contained in:
@@ -1,3 +1,4 @@
|
|||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using HybridCLR.Editor.Commands;
|
using HybridCLR.Editor.Commands;
|
||||||
@@ -47,16 +48,16 @@ namespace Stary.Evo.Editor
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void OneShaderMark()
|
public static void OneShaderMark(Action<string> complete)
|
||||||
{
|
{
|
||||||
OneShaderMark(GetOneKeyBuildEntities());
|
OneShaderMark(GetOneKeyBuildEntities(),complete);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// (一键)收集shader【材质异常或资源修改】
|
/// (一键)收集shader【材质异常或资源修改】
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="oneKeyBuildEntities"></param>
|
/// <param name="oneKeyBuildEntities"></param>
|
||||||
public static void OneShaderMark(List<OneKeyBuildEntity> oneKeyBuildEntities)
|
public static void OneShaderMark(List<OneKeyBuildEntity> oneKeyBuildEntities,Action<string> complete)
|
||||||
{
|
{
|
||||||
#if HotUpdate
|
#if HotUpdate
|
||||||
//标记全部资源
|
//标记全部资源
|
||||||
@@ -65,7 +66,10 @@ namespace Stary.Evo.Editor
|
|||||||
if (oneKeyBUildEntity.isRaw)
|
if (oneKeyBUildEntity.isRaw)
|
||||||
{
|
{
|
||||||
MarkAdressable.CollectSvc(MarkAdressable.DomainRoot, oneKeyBUildEntity.DomainName,
|
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.KeepFiles=new string[0];
|
||||||
StreamingAssetsFilter.OnPreprocessBuild();
|
StreamingAssetsFilter.OnPreprocessBuild();
|
||||||
}
|
}
|
||||||
|
ShowNotification(new GUIContent("拷贝完成!"), 2f);
|
||||||
}
|
}
|
||||||
[ButtonGroup]
|
[ButtonGroup]
|
||||||
[Button("$GetBuildAPKName", ButtonSizes.Large, ButtonStyle.FoldoutButton)]
|
[Button("$GetBuildAPKName", ButtonSizes.Large, ButtonStyle.FoldoutButton)]
|
||||||
|
|||||||
@@ -44,7 +44,8 @@ public static class StreamingAssetsFilter
|
|||||||
// 移动到临时目录
|
// 移动到临时目录
|
||||||
string backupPath = Path.Combine(tempBackupPath, relativePath);
|
string backupPath = Path.Combine(tempBackupPath, relativePath);
|
||||||
Directory.CreateDirectory(Path.GetDirectoryName(backupPath));
|
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, "")
|
string relativePath = file.Replace(tempBackupPath + Path.DirectorySeparatorChar, "")
|
||||||
.Replace(tempBackupPath, "");
|
.Replace(tempBackupPath, "");
|
||||||
string originalPath = Path.Combine(streamingAssetsPath, relativePath);
|
string originalPath = Path.Combine(streamingAssetsPath, relativePath);
|
||||||
|
// 检查目标文件是否已存在
|
||||||
|
if (File.Exists(originalPath))
|
||||||
|
{
|
||||||
|
Debug.Log($"跳过恢复: {originalPath} (文件已存在)");
|
||||||
|
return;
|
||||||
|
}
|
||||||
Directory.CreateDirectory(Path.GetDirectoryName(originalPath));
|
Directory.CreateDirectory(Path.GetDirectoryName(originalPath));
|
||||||
File.Move(file, originalPath);
|
File.Move(file, originalPath);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -52,7 +52,6 @@ namespace Stary.Evo.Editor
|
|||||||
// 添加新模式
|
// 添加新模式
|
||||||
defines.Add(mode.ToString());
|
defines.Add(mode.ToString());
|
||||||
PlayerSettings.SetScriptingDefineSymbolsForGroup(currentTarget, string.Join(";", defines));
|
PlayerSettings.SetScriptingDefineSymbolsForGroup(currentTarget, string.Join(";", defines));
|
||||||
Debug.Log($"当前编译符号: {string.Join(";", defines)}"); // 添加调试日志
|
|
||||||
_hotUpdate = mode;
|
_hotUpdate = mode;
|
||||||
CustomEditorPrefs.SetString("ChangeHotUpdateSchema", _hotUpdate.ToString());
|
CustomEditorPrefs.SetString("ChangeHotUpdateSchema", _hotUpdate.ToString());
|
||||||
|
|
||||||
@@ -61,9 +60,8 @@ namespace Stary.Evo.Editor
|
|||||||
// 添加解决方案文件重新生成逻辑
|
// 添加解决方案文件重新生成逻辑
|
||||||
EditorApplication.delayCall += () =>
|
EditorApplication.delayCall += () =>
|
||||||
{
|
{
|
||||||
EditorApplication.ExecuteMenuItem("Assets/Open C# Project");
|
|
||||||
UnityEditor.Compilation.CompilationPipeline.RequestScriptCompilation();
|
UnityEditor.Compilation.CompilationPipeline.RequestScriptCompilation();
|
||||||
Debug.Log("已强制重新生成解决方案文件");
|
Debug.Log($"当前编译符号: {string.Join(";", defines)}"); // 添加调试日志
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -55,7 +55,6 @@ namespace Stary.Evo.Editor
|
|||||||
// 添加新模式
|
// 添加新模式
|
||||||
defines.Add(mode.ToString());
|
defines.Add(mode.ToString());
|
||||||
PlayerSettings.SetScriptingDefineSymbolsForGroup(currentTarget, string.Join(";", defines));
|
PlayerSettings.SetScriptingDefineSymbolsForGroup(currentTarget, string.Join(";", defines));
|
||||||
Debug.Log($"当前编译符号: {string.Join(";", defines)}"); // 添加调试日志
|
|
||||||
_pLayerMode = mode;
|
_pLayerMode = mode;
|
||||||
CustomEditorPrefs.SetString("ChangePlayerSchema", _pLayerMode.ToString());
|
CustomEditorPrefs.SetString("ChangePlayerSchema", _pLayerMode.ToString());
|
||||||
ValidateModeMenu();
|
ValidateModeMenu();
|
||||||
@@ -65,7 +64,7 @@ namespace Stary.Evo.Editor
|
|||||||
{
|
{
|
||||||
//EditorApplication.ExecuteMenuItem("Assets/Open C# Project");
|
//EditorApplication.ExecuteMenuItem("Assets/Open C# Project");
|
||||||
UnityEditor.Compilation.CompilationPipeline.RequestScriptCompilation();
|
UnityEditor.Compilation.CompilationPipeline.RequestScriptCompilation();
|
||||||
Debug.Log("已强制重新生成解决方案文件");
|
Debug.Log($"当前编译符号: {string.Join(";", defines)}"); // 添加调试日志
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -52,7 +52,6 @@ namespace Stary.Evo.Editor
|
|||||||
// 添加新模式
|
// 添加新模式
|
||||||
defines.Add(mode.ToString());
|
defines.Add(mode.ToString());
|
||||||
PlayerSettings.SetScriptingDefineSymbolsForGroup(currentTarget, string.Join(";", defines));
|
PlayerSettings.SetScriptingDefineSymbolsForGroup(currentTarget, string.Join(";", defines));
|
||||||
Debug.Log($"当前编译符号: {string.Join(";", defines)}"); // 添加调试日志
|
|
||||||
_pointClondMode = mode;
|
_pointClondMode = mode;
|
||||||
CustomEditorPrefs.SetString("ChangePoindClondSchema", _pointClondMode.ToString());
|
CustomEditorPrefs.SetString("ChangePoindClondSchema", _pointClondMode.ToString());
|
||||||
|
|
||||||
@@ -61,9 +60,8 @@ namespace Stary.Evo.Editor
|
|||||||
// 添加解决方案文件重新生成逻辑
|
// 添加解决方案文件重新生成逻辑
|
||||||
EditorApplication.delayCall += () =>
|
EditorApplication.delayCall += () =>
|
||||||
{
|
{
|
||||||
EditorApplication.ExecuteMenuItem("Assets/Open C# Project");
|
|
||||||
UnityEditor.Compilation.CompilationPipeline.RequestScriptCompilation();
|
UnityEditor.Compilation.CompilationPipeline.RequestScriptCompilation();
|
||||||
Debug.Log("已强制重新生成解决方案文件");
|
Debug.Log($"当前编译符号: {string.Join(";", defines)}"); // 添加调试日志
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -64,9 +64,8 @@ namespace Stary.Evo.Editor
|
|||||||
{
|
{
|
||||||
#if HotUpdate
|
#if HotUpdate
|
||||||
EditorTools.ClearUnityConsole();
|
EditorTools.ClearUnityConsole();
|
||||||
AutoBuildPackage.OneShaderMark(OneKeyBuildEntities);
|
AutoBuildPackage.OneShaderMark(OneKeyBuildEntities,(domainName)=>
|
||||||
|
ShowNotification(new GUIContent($"收集【{domainName}】的shader【材质异常或资源修改】!"), 2f));
|
||||||
EditorUtility.DisplayDialog("提示", $"标记所有shader完成!", "确定");
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "com.staryevo.tools",
|
"name": "com.staryevo.tools",
|
||||||
"version": "1.3.25",
|
"version": "1.3.26",
|
||||||
"displayName": "00.StaryEvo.Tools",
|
"displayName": "00.StaryEvo.Tools",
|
||||||
"description": "This is an Framework package(后台服务器版本,端口9527)",
|
"description": "This is an Framework package(后台服务器版本,端口9527)",
|
||||||
"unity": "2021.3",
|
"unity": "2021.3",
|
||||||
|
|||||||
Reference in New Issue
Block a user