This commit is contained in:
陈思海 2025-10-14 16:08:51 +08:00
parent 5369ced5eb
commit 3566d135af

View File

@ -1,30 +1,20 @@
#if HYBIRDCLR_SUPPORT #if HYBIRDCLR_SUPPORT
#if ENABLE_HYBRIDCLR
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using HybridCLR.Editor; using HybridCLR.Editor;
using HybridCLR.Editor.Commands; using HybridCLR.Editor.Commands;
#endif
using System.Reflection; using System.Reflection;
using AlicizaX; using AlicizaX;
using AlicizaX.Editor; using AlicizaX.Editor;
using UnityEditor; using UnityEditor;
using UnityEngine; using UnityEngine;
[InitializeOnLoad]
public static class BuildDLLCommand public static class BuildDLLCommand
{ {
private const string EnableHybridClrScriptingDefineSymbol = "ENABLE_HYBRIDCLR"; private const string EnableHybridClrScriptingDefineSymbol = "ENABLE_HYBRIDCLR";
public static string AssemblyTextAssetPath = Application.dataPath + "/" + "Bundles/DLL"; public static string AssemblyTextAssetPath = Application.dataPath + "/" + "Bundles/DLL";
public static void SetCopyPath(string path)
{
AssemblyTextAssetPath = path;
}
/// <summary> /// <summary>
/// 禁用HybridCLR宏定义。 /// 禁用HybridCLR宏定义。
/// </summary> /// </summary>
@ -46,7 +36,7 @@ public static class BuildDLLCommand
HybridCLR.Editor.SettingsUtil.Enable = true; HybridCLR.Editor.SettingsUtil.Enable = true;
} }
#if ENABLE_HYBRIDCLR &&HYBIRDCLR_SUPPORT
[MenuItem("HybridCLR/Tools/BuildAssets And CopyTo AssemblyTextAssetPath")] [MenuItem("HybridCLR/Tools/BuildAssets And CopyTo AssemblyTextAssetPath")]
public static void BuildAndCopyDlls() public static void BuildAndCopyDlls()
{ {
@ -56,7 +46,7 @@ public static class BuildDLLCommand
} }
public static void GenerateHybridCLRSome() public static void GenerateAll()
{ {
PrebuildCommand.GenerateAll(); PrebuildCommand.GenerateAll();
} }
@ -111,6 +101,7 @@ public static class BuildDLLCommand
{ {
return null; return null;
} }
FileInfo info = new FileInfo(scriptPath); FileInfo info = new FileInfo(scriptPath);
string scriptTypeName = info.Name.Replace(".cs", ""); string scriptTypeName = info.Name.Replace(".cs", "");
@ -149,6 +140,5 @@ public static class BuildDLLCommand
Debug.Log($"[CopyHotUpdateAssembliesToStreamingAssets] copy hotfix dll {dllPath} -> {dllBytesPath}"); Debug.Log($"[CopyHotUpdateAssembliesToStreamingAssets] copy hotfix dll {dllPath} -> {dllBytesPath}");
} }
} }
#endif
} }
#endif #endif