mirror of
https://github.com/Alex-Rachel/TEngine.git
synced 2025-08-14 16:51:28 +00:00
HybirdCLRInjector
HybirdCLRInjector
This commit is contained in:
@@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 5441af6e690e22643970bc4bafba0eb9
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
@@ -0,0 +1,42 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.IO;
|
||||||
|
using HybridCLR.Editor;
|
||||||
|
using TEngine.Runtime;
|
||||||
|
using UnityEditor;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
namespace TEngine.Editor
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// HybirdCLR 热更新 打包插入管线
|
||||||
|
/// </summary>
|
||||||
|
public static class HybirdCLRInjectorEditor
|
||||||
|
{
|
||||||
|
[TEngineBuilderInjector(BuilderInjectorMoment.BeforeCollect_AssetBundle)]
|
||||||
|
public static void BeforeCollectAssetBundle()
|
||||||
|
{
|
||||||
|
CompileDllHelper.CompileDllActiveBuildTarget();
|
||||||
|
Log.Warning("CompileDllHelper.CompileDllActiveBuildTarget()");
|
||||||
|
|
||||||
|
var target = EditorUserBuildSettings.activeBuildTarget;
|
||||||
|
var dllDir = Constant.Setting.AssetRootPath+"/Dll";
|
||||||
|
|
||||||
|
string hotfixDllSrcDir = BuildConfig.GetHotFixDllsOutputDirByTarget(target);
|
||||||
|
foreach (var dll in BuildConfig.HotUpdateAssemblies)
|
||||||
|
{
|
||||||
|
string dllPath = $"{hotfixDllSrcDir}/{dll}";
|
||||||
|
string dllBytesPath = $"{dllDir}/{dll}.bytes";
|
||||||
|
try
|
||||||
|
{
|
||||||
|
File.Copy(dllPath, dllBytesPath, true);
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Log.Fatal(e.Message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: b0d3fa47cdbec26468b426ee8e23e245
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
@@ -1,11 +1,4 @@
|
|||||||
using System;
|
using System.Collections.Generic;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.IO;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using UnityEditor;
|
|
||||||
using UnityEngine;
|
|
||||||
|
|
||||||
namespace HybridCLR.Editor
|
namespace HybridCLR.Editor
|
||||||
{
|
{
|
||||||
@@ -17,8 +10,8 @@ namespace HybridCLR.Editor
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public static List<string> HotUpdateAssemblies { get; } = new List<string>
|
public static List<string> HotUpdateAssemblies { get; } = new List<string>
|
||||||
{
|
{
|
||||||
|
"TEngine.Runtime.dll",
|
||||||
"HotFix.dll",
|
"HotFix.dll",
|
||||||
"HotFix2.dll",
|
|
||||||
};
|
};
|
||||||
|
|
||||||
public static List<string> AOTMetaAssemblies { get; } = new List<string>()
|
public static List<string> AOTMetaAssemblies { get; } = new List<string>()
|
||||||
|
Reference in New Issue
Block a user