diff --git a/Assets/GameFramework/Editor/BuildTool.cs b/Assets/GameFramework/Editor/BuildTool.cs new file mode 100644 index 0000000..9b09099 --- /dev/null +++ b/Assets/GameFramework/Editor/BuildTool.cs @@ -0,0 +1,88 @@ +using UnityEditor; +using UnityEngine; +using YooAsset.Editor; +using YooAsset; +using System; +using System.Collections.Generic; +using UnityEditor.Build.Pipeline; + +public class BuildTool +{ + [MenuItem("Tools/打包Preload")] + public static void BuildPreload() + { + CopyHotDll.CopyPreloadDll2Byte(); + ExecuteBuild("Preload",EBuildPipeline.ScriptableBuildPipeline, EditorUserBuildSettings.activeBuildTarget,EFileNameStyle.BundleName,EBuildinFileCopyOption.ClearAndCopyAll); + Debug.Log($"打包Preload结束"); + } + [MenuItem("Tools/打包Main %G")] + public static void BuildMain() + { + CopyHotDll.CopyMainDll2Byte(); + ExecuteBuild("Main", EBuildPipeline.ScriptableBuildPipeline, EditorUserBuildSettings.activeBuildTarget, EFileNameStyle.BundleName, EBuildinFileCopyOption.None); + Debug.Log($"打包Main结束"); + } + [MenuItem("Tools/全部打包")] + public static void BuildAll() + { + BuildPreload(); + BuildMain(); + } + + public static void ExecuteBuild(string PackageName, EBuildPipeline BuildPipeline, BuildTarget BuildTarget, EFileNameStyle fileNameStyle, EBuildinFileCopyOption buildinFileCopyOption) + { + var buildinFileCopyParams = AssetBundleBuilderSetting.GetPackageBuildinFileCopyParams(PackageName, BuildPipeline.ToString()); + var compressOption = AssetBundleBuilderSetting.GetPackageCompressOption(PackageName, BuildPipeline.ToString()); + var clearBuildCache = AssetBundleBuilderSetting.GetPackageClearBuildCache(PackageName, BuildPipeline.ToString()); + var useAssetDependencyDB = AssetBundleBuilderSetting.GetPackageUseAssetDependencyDB(PackageName, BuildPipeline.ToString()); + var builtinShaderBundleName = GetBuiltinShaderBundleName(PackageName); + + ScriptableBuildParameters buildParameters = new ScriptableBuildParameters(); + buildParameters.BuildOutputRoot = AssetBundleBuilderHelper.GetDefaultBuildOutputRoot(); + buildParameters.BuildinFileRoot = AssetBundleBuilderHelper.GetStreamingAssetsRoot(); + buildParameters.BuildPipeline = BuildPipeline.ToString(); + buildParameters.BuildBundleType = (int)EBuildBundleType.AssetBundle; + buildParameters.BuildTarget = BuildTarget; + buildParameters.PackageName = PackageName; + buildParameters.PackageVersion = GetPackageVersion(); + buildParameters.EnableSharePackRule = true; + buildParameters.VerifyBuildingResult = true; + buildParameters.FileNameStyle = fileNameStyle; + buildParameters.BuildinFileCopyOption = buildinFileCopyOption; + buildParameters.BuildinFileCopyParams = buildinFileCopyParams; + buildParameters.CompressOption = compressOption; + buildParameters.ClearBuildCacheFiles = clearBuildCache; + buildParameters.UseAssetDependencyDB = useAssetDependencyDB; + buildParameters.BuiltinShadersBundleName = builtinShaderBundleName; + buildParameters.EncryptionServices = CreateEncryptionInstance(PackageName, BuildPipeline); + + ScriptableBuildPipeline pipeline = new ScriptableBuildPipeline(); + var buildResult = pipeline.Run(buildParameters, true); + if (buildResult.Success) + EditorUtility.RevealInFinder(buildResult.OutputPackageDirectory); + } + public static string GetPackageVersion() + { + int totalMinutes = DateTime.Now.Hour * 60 + DateTime.Now.Minute; + return DateTime.Now.ToString("yyyy-MM-dd") + "-" + totalMinutes; + } + + private static string GetBuiltinShaderBundleName(string PackageName) + { + var uniqueBundleName = AssetBundleCollectorSettingData.Setting.UniqueBundleName; + var packRuleResult = DefaultPackRule.CreateShadersPackRuleResult(); + return packRuleResult.GetBundleName(PackageName, uniqueBundleName); + } + public static IEncryptionServices CreateEncryptionInstance(string PackageName, EBuildPipeline BuildPipeline) + { + var encyptionClassName = AssetBundleBuilderSetting.GetPackageEncyptionServicesClassName(PackageName, BuildPipeline.ToString()); + var encryptionClassTypes = EditorTools.GetAssignableTypes(typeof(IEncryptionServices)); + var classType = encryptionClassTypes.Find(x => x.FullName.Equals(encyptionClassName)); + if (classType != null) + return (IEncryptionServices)Activator.CreateInstance(classType); + else + return null; + } +} + + diff --git a/Assets/GameFramework/Editor/BuildTool.cs.meta b/Assets/GameFramework/Editor/BuildTool.cs.meta new file mode 100644 index 0000000..8ad9e51 --- /dev/null +++ b/Assets/GameFramework/Editor/BuildTool.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: ef4dc48fe62a00246bf7a5beb87f7c4a \ No newline at end of file diff --git a/Assets/GameFramework/Editor/CopyHotDll.cs b/Assets/GameFramework/Editor/CopyHotDll.cs new file mode 100644 index 0000000..2e7efe4 --- /dev/null +++ b/Assets/GameFramework/Editor/CopyHotDll.cs @@ -0,0 +1,63 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEditor; +using UnityEngine; +using System; +using System.IO; +using System.Text; + + +public class CopyHotDll +{ + [MenuItem("Tools/更新生成PreloadDll")] + public static void CopyPreloadDll2Byte() + { + HybridCLR.Editor.Commands.CompileDllCommand.CompileDllActiveBuildTarget(); + string sourceDir = $"{Application.dataPath.Replace("/Assets", "")}/HybridCLRData/HotUpdateDlls/{UnityEditor.EditorUserBuildSettings.activeBuildTarget}/GameScripts.Preload.dll"; + string destDir = $"{Application.dataPath}/GameRes/Preload/HotUpdateDll/GameScripts.Preload.bytes"; + if (File.Exists(destDir)) + { + File.Delete(destDir); + } + File.Copy(sourceDir, destDir); + AssetDatabase.Refresh(); + Debug.Log($"copy {sourceDir} to {destDir}"); + } + [MenuItem("Tools/更新生成MainDll")] + public static void CopyMainDll2Byte() + { + HybridCLR.Editor.Commands.CompileDllCommand.CompileDllActiveBuildTarget(); + string sourceDir = $"{Application.dataPath.Replace("/Assets", "")}/HybridCLRData/HotUpdateDlls/{UnityEditor.EditorUserBuildSettings.activeBuildTarget}/GameScripts.Main.dll"; + string destDir = $"{Application.dataPath}/GameRes/Main/HotUpdateDll/GameScripts.Main.bytes"; + if (File.Exists(destDir)) + { + File.Delete(destDir); + } + File.Copy(sourceDir, destDir); + AssetDatabase.Refresh(); + Debug.Log($"copy {sourceDir} to {destDir}"); + } + [MenuItem("Tools/更新生成补充数据源")] + public static void CopyDepDll2Byte() + { + HybridCLR.Editor.Commands.CompileDllCommand.CompileDllActiveBuildTarget(); + string sourceDir = $"{Application.dataPath.Replace("/Assets", "")}/HybridCLRData/AssembliesPostIl2CppStrip/{UnityEditor.EditorUserBuildSettings.activeBuildTarget}/"; + string destDir = $"{Application.dataPath}/GameRes/Main/HotUpdateDll/"; + foreach (string dll in Boot.Inst.DepDlls) + { + string sourcePath = $"{sourceDir}/{dll}"; + string destPath = $"{destDir}/{dll}.bytes"; + if (File.Exists(sourcePath)) + { + if (File.Exists(destPath)) + { + File.Delete(destPath); + } + File.Copy(sourcePath, destPath); + AssetDatabase.Refresh(); + Debug.Log($"copy {sourcePath} to {destPath}"); + } + } + Debug.Log("copy over"); + } +} diff --git a/Assets/GameFramework/Editor/CopyHotDll.cs.meta b/Assets/GameFramework/Editor/CopyHotDll.cs.meta new file mode 100644 index 0000000..4cdbff8 --- /dev/null +++ b/Assets/GameFramework/Editor/CopyHotDll.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 4a15e4a3e4bbd7c4c9c3783ac0028089 \ No newline at end of file diff --git a/Assets/GameFramework/Runtime/Boot.cs b/Assets/GameFramework/Runtime/Boot.cs index ada9988..bfc141f 100644 --- a/Assets/GameFramework/Runtime/Boot.cs +++ b/Assets/GameFramework/Runtime/Boot.cs @@ -1,9 +1,16 @@ +using System.Collections.Generic; using UnityEngine; -using UnityEngine.SceneManagement; using YooAsset; -public class Boot : MonoBehaviour +public class Boot : SingletonMono { + public List DepDlls = new List() + { + "mscorlib.dll", + "System.dll", + "System.Core.dll", + "Mirror.dll" + }; public GameObject MainUICanvas; public Camera UICamera; public EPlayMode PlayMode = EPlayMode.EditorSimulateMode; diff --git a/Assets/GameFramework/Runtime/GameFramework.Runtime.asmdef b/Assets/GameFramework/Runtime/GameFramework.Runtime.asmdef new file mode 100644 index 0000000..01a6226 --- /dev/null +++ b/Assets/GameFramework/Runtime/GameFramework.Runtime.asmdef @@ -0,0 +1,19 @@ +{ + "name": "GameFramework.Runtime", + "rootNamespace": "", + "references": [ + "GUID:e34a5702dd353724aa315fb8011f08c3", + "GUID:f51ebe6a0ceec4240a699833d6309b23", + "GUID:3fe1a3e70da50184f9897101cad7e4f2", + "GUID:13ba8ce62aa80c74598530029cb2d649" + ], + "includePlatforms": [], + "excludePlatforms": [], + "allowUnsafeCode": false, + "overrideReferences": false, + "precompiledReferences": [], + "autoReferenced": true, + "defineConstraints": [], + "versionDefines": [], + "noEngineReferences": false +} \ No newline at end of file diff --git a/Assets/GameFramework/Runtime/GameFramework.Runtime.asmdef.meta b/Assets/GameFramework/Runtime/GameFramework.Runtime.asmdef.meta new file mode 100644 index 0000000..1996898 --- /dev/null +++ b/Assets/GameFramework/Runtime/GameFramework.Runtime.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 63f032f8696ad5b4e99c26f7a9f89060 +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/GameFramework/Runtime/PatchLogic/HotDllLoader.cs b/Assets/GameFramework/Runtime/PatchLogic/HotDllLoader.cs new file mode 100644 index 0000000..b81fc77 --- /dev/null +++ b/Assets/GameFramework/Runtime/PatchLogic/HotDllLoader.cs @@ -0,0 +1,34 @@ +using HybridCLR; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using UnityEngine; +using YooAsset; + +public class HotDllLoader : Singleton +{ + public void LoadDll(ResourcePackage package, string dll) + { + if (package.GetAssetInfo(dll).Error == string.Empty) + { + AssetHandle handle = package.LoadAssetSync(dll); +#if UNITY_EDITOR + Assembly hotUpdateAss = System.AppDomain.CurrentDomain.GetAssemblies().First(a => a.GetName().Name == dll.Replace(".dll", "")); +#else + Assembly hotUpdateAss = Assembly.Load((handle.AssetObject as TextAsset).bytes); +#endif + Debug.Log($"{dll}"); + } + } + public void LoadDepDll(ResourcePackage package, List dlls) + { + foreach (string dll in dlls) + { + if (package.GetAssetInfo(dll).Error == string.Empty) + { + AssetHandle handle = package.LoadAssetSync(dll); + RuntimeApi.LoadMetadataForAOTAssembly((handle.AssetObject as TextAsset).bytes, HomologousImageMode.SuperSet); + } + } + } +} diff --git a/Assets/GameFramework/Runtime/PatchLogic/HotDllLoader.cs.meta b/Assets/GameFramework/Runtime/PatchLogic/HotDllLoader.cs.meta new file mode 100644 index 0000000..18ee350 --- /dev/null +++ b/Assets/GameFramework/Runtime/PatchLogic/HotDllLoader.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 913490bf1a0079744825742899c17961 \ No newline at end of file diff --git a/Assets/GameFramework/Runtime/PatchLogic/MainOperation.cs b/Assets/GameFramework/Runtime/PatchLogic/MainOperation.cs index 307758e..61fe664 100644 --- a/Assets/GameFramework/Runtime/PatchLogic/MainOperation.cs +++ b/Assets/GameFramework/Runtime/PatchLogic/MainOperation.cs @@ -1,4 +1,5 @@ using Cysharp.Threading.Tasks; +using System; using UnityEngine; using YooAsset; @@ -6,7 +7,8 @@ public class MainOperation { PatchOperationData data; PatchOperation operation; - public MainOperation(EPlayMode playMode) + bool autoDownload; + public MainOperation(EPlayMode playMode, bool autoDownload = false) { data = new PatchOperationData(); data.packageName = "Main"; @@ -14,12 +16,18 @@ public class MainOperation data.useBuildinFileSystem = false; data.downloadingMaxNum = 10; data.failedTryAgain = 3; + data.downloadUpdate = OnDownloadUpdate; + data.downloadFinish = OnDownloadFinish; + data.downloadError = OnDownloadError; operation = new PatchOperation(data); + this.autoDownload = autoDownload; } public async UniTask Execute() { + + PatchEvent.UpdateProgress(0f); InitializationOperation initializationOperation = await operation.InitializePackage(); //ʼʧ if (initializationOperation.Status != EOperationStatus.Succeed) @@ -30,6 +38,8 @@ public class MainOperation .AddButton("˳", (box) => { Application.Quit(); }); return; } + PatchEvent.UpdateStatus($"ʼɹ{operation.data.packageName}"); + Debug.Log($"ʼɹ{operation.data.packageName}"); var PackageVersionOperation = await operation.RequestPackageVersion(); if (PackageVersionOperation.Status != EOperationStatus.Succeed) { @@ -40,6 +50,8 @@ public class MainOperation return; } operation.packageVersion = PackageVersionOperation.PackageVersion; + PatchEvent.UpdateStatus($"ȡ汾ɹ{operation.data.packageName}"); + Debug.Log($"ȡ汾ɹ{operation.data.packageName}{operation.packageVersion}"); var PackageManifestOperation = await operation.UpdatePackageManifest(); if (PackageManifestOperation.Status != EOperationStatus.Succeed) { @@ -53,25 +65,83 @@ public class MainOperation if (DownloaderOperation.TotalDownloadCount == 0) { operation.SaveVersionToCache(); + PatchEvent.UpdateStatus($"{operation.data.packageName}"); + Debug.Log($"{operation.data.packageName}ɣ汾{operation.packageVersion}"); return; } + else + { + if (autoDownload) + { + if (!await Download(DownloaderOperation)) return; + } + else + { + var completionSource = new UniTaskCompletionSource(); + MessageBox.Show() + .SetTitle(operation.data.packageName) + .SetContent($"Դ\n{operation.GetCachedPackageVersion()}=>{operation.packageVersion}: {DownloaderOperation.TotalDownloadBytes / 1024f / 1024f:F1}MB") + .AddButton("", async (box) => + { + bool success = await Download(DownloaderOperation); + completionSource.TrySetResult(success); + }) + .AddButton("", (box) => + { + DownloaderOperation.CancelDownload(); + completionSource.TrySetResult(true); + }) + .AddButton("˳", (box) => + { + completionSource.TrySetResult(false); + Application.Quit(); + }); + bool shouldContinue = await completionSource.Task; + if (!shouldContinue) return; + } + var ClearCacheFilesOperation = await operation.ClearCacheBundle(); + if (ClearCacheFilesOperation.Status != EOperationStatus.Succeed) + { + MessageBox.Show() + .SetTitle(operation.data.packageName) + .SetContent($"{ClearCacheFilesOperation.Error}") + .AddButton("˳", (box) => { Application.Quit(); }); + return; + } + operation.SaveVersionToCache(); + PatchEvent.UpdateStatus($"{operation.data.packageName}"); + Debug.Log($"{operation.data.packageName}ɣ汾{operation.packageVersion}"); + } + } + public async UniTask Download(DownloaderOperation downloaderOperation) + { if (!await operation.DownloadPackageFiles()) { MessageBox.Show() .SetTitle(operation.data.packageName) - .SetContent($"{DownloaderOperation.Error}") + .SetContent($"{downloaderOperation.Error}") .AddButton("˳", (box) => { Application.Quit(); }); - return; + return false; } - var ClearCacheFilesOperation = await operation.ClearCacheBundle(); - if (ClearCacheFilesOperation.Status != EOperationStatus.Succeed) - { - MessageBox.Show() - .SetTitle(operation.data.packageName) - .SetContent($"{ClearCacheFilesOperation.Error}") - .AddButton("˳", (box) => { Application.Quit(); }); - return; - } - operation.SaveVersionToCache(); + return true; + } + private void OnDownloadUpdate(DownloadUpdateData downloadUpdateData) + { + float progress = (float)downloadUpdateData.CurrentDownloadBytes / downloadUpdateData.TotalDownloadBytes; + string sizeText = $"{(downloadUpdateData.CurrentDownloadBytes / 1024f / 1024f):F1}MB / {(downloadUpdateData.TotalDownloadBytes / 1024f / 1024f):F1}MB"; + + PatchEvent.UpdateProgress(progress); + PatchEvent.UpdateDownloadSize(sizeText); + PatchEvent.UpdateStatus($"{data.packageName} Դ..."); + } + + private void OnDownloadFinish(DownloaderFinishData downloaderFinishData) + { + PatchEvent.UpdateStatus(""); + } + + private void OnDownloadError(DownloadErrorData downloadErrorData) + { + PatchEvent.UpdateStatus($"ʧ:{downloadErrorData.FileName}\n{downloadErrorData.ErrorInfo}"); } } diff --git a/Assets/GameFramework/Runtime/PatchLogic/PatchEvent.cs b/Assets/GameFramework/Runtime/PatchLogic/PatchEvent.cs new file mode 100644 index 0000000..ada0e60 --- /dev/null +++ b/Assets/GameFramework/Runtime/PatchLogic/PatchEvent.cs @@ -0,0 +1,24 @@ +using System; +using UnityEngine; + +public static class PatchEvent +{ + public static event Action OnStatusUpdate; + public static event Action OnProgressUpdate; + public static event Action OnDownloadSizeUpdate; + + public static void UpdateStatus(string status) + { + OnStatusUpdate?.Invoke(status); + } + + public static void UpdateProgress(float progress) + { + OnProgressUpdate?.Invoke(progress); + } + + public static void UpdateDownloadSize(string sizeText) + { + OnDownloadSizeUpdate?.Invoke(sizeText); + } +} diff --git a/Assets/GameFramework/Runtime/PatchLogic/PatchEvent.cs.meta b/Assets/GameFramework/Runtime/PatchLogic/PatchEvent.cs.meta new file mode 100644 index 0000000..1933568 --- /dev/null +++ b/Assets/GameFramework/Runtime/PatchLogic/PatchEvent.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: e733509362b9e5445b0354a734ec8c10 \ No newline at end of file diff --git a/Assets/GameRes/Main/HotUpdateDll.meta b/Assets/GameRes/Main/HotUpdateDll.meta new file mode 100644 index 0000000..a8ef4c8 --- /dev/null +++ b/Assets/GameRes/Main/HotUpdateDll.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 0bd22a8b75fd12a47a8a037cd34776a3 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/GameRes/Preload/HotUpdateDll.meta b/Assets/GameRes/Preload/HotUpdateDll.meta new file mode 100644 index 0000000..a73e420 --- /dev/null +++ b/Assets/GameRes/Preload/HotUpdateDll.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 4637316722ac8274c9c67684dad27c05 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/GameRes/Preload/HotUpdateDll/GameScripts.Preload.bytes b/Assets/GameRes/Preload/HotUpdateDll/GameScripts.Preload.bytes new file mode 100644 index 0000000..52fac35 Binary files /dev/null and b/Assets/GameRes/Preload/HotUpdateDll/GameScripts.Preload.bytes differ diff --git a/Assets/GameRes/Preload/HotUpdateDll/GameScripts.Preload.bytes.meta b/Assets/GameRes/Preload/HotUpdateDll/GameScripts.Preload.bytes.meta new file mode 100644 index 0000000..eb97c11 --- /dev/null +++ b/Assets/GameRes/Preload/HotUpdateDll/GameScripts.Preload.bytes.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: e6a52de6997544b428ae088f4b2ee203 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/GameScripts/Preload/GameScripts.Preload.asmdef b/Assets/GameScripts/Preload/GameScripts.Preload.asmdef new file mode 100644 index 0000000..436f040 --- /dev/null +++ b/Assets/GameScripts/Preload/GameScripts.Preload.asmdef @@ -0,0 +1,16 @@ +{ + "name": "GameScripts.Preload", + "rootNamespace": "", + "references": [ + "GUID:63f032f8696ad5b4e99c26f7a9f89060" + ], + "includePlatforms": [], + "excludePlatforms": [], + "allowUnsafeCode": false, + "overrideReferences": false, + "precompiledReferences": [], + "autoReferenced": true, + "defineConstraints": [], + "versionDefines": [], + "noEngineReferences": false +} \ No newline at end of file diff --git a/Assets/GameScripts/Preload/GameScripts.Preload.asmdef.meta b/Assets/GameScripts/Preload/GameScripts.Preload.asmdef.meta new file mode 100644 index 0000000..12ff2c4 --- /dev/null +++ b/Assets/GameScripts/Preload/GameScripts.Preload.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 921b262766d31374c8fd93ad67954b9c +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/GameScripts/Preload/PatchWindow.cs b/Assets/GameScripts/Preload/PatchWindow.cs index 166f246..b2d663a 100644 --- a/Assets/GameScripts/Preload/PatchWindow.cs +++ b/Assets/GameScripts/Preload/PatchWindow.cs @@ -11,5 +11,32 @@ public class PatchWindow : MonoBehaviour private void Awake() { video.targetCamera = GameManager.Inst.UICamera; + PatchEvent.OnStatusUpdate += OnStatusUpdate; + PatchEvent.OnProgressUpdate += OnProgressUpdate; + PatchEvent.OnDownloadSizeUpdate += OnDownloadSizeUpdate; + } + private void OnDestroy() + { + PatchEvent.OnStatusUpdate -= OnStatusUpdate; + PatchEvent.OnProgressUpdate -= OnProgressUpdate; + PatchEvent.OnDownloadSizeUpdate -= OnDownloadSizeUpdate; + } + + private void OnStatusUpdate(string status) + { + if (statusText != null) + statusText.text = status; + } + + private void OnProgressUpdate(float progress) + { + if (progressBar != null) + progressBar.value = progress; + } + + private void OnDownloadSizeUpdate(string sizeText) + { + if (downloadSizeText != null) + downloadSizeText.text = sizeText; } } diff --git a/Assets/GameSetting/AssetBundleCollectorConfig.xml b/Assets/GameSetting/AssetBundleCollectorConfig.xml index 1f04d02..53da099 100644 --- a/Assets/GameSetting/AssetBundleCollectorConfig.xml +++ b/Assets/GameSetting/AssetBundleCollectorConfig.xml @@ -5,10 +5,16 @@ + + + + + + \ No newline at end of file diff --git a/Assets/GameSetting/AssetBundleCollectorSetting.asset b/Assets/GameSetting/AssetBundleCollectorSetting.asset index fa42581..bb10cdc 100644 --- a/Assets/GameSetting/AssetBundleCollectorSetting.asset +++ b/Assets/GameSetting/AssetBundleCollectorSetting.asset @@ -38,6 +38,19 @@ MonoBehaviour: FilterRuleName: CollectAll AssetTags: UserData: + - GroupName: HotUpdateDll + GroupDesc: + AssetTags: + ActiveRuleName: EnableGroup + Collectors: + - CollectPath: Assets/GameRes/Preload/HotUpdateDll + CollectorGUID: 4637316722ac8274c9c67684dad27c05 + CollectorType: 0 + AddressRuleName: AddressByFileName + PackRuleName: PackDirectory + FilterRuleName: CollectAll + AssetTags: + UserData: - PackageName: Main PackageDesc: "\u4E3B\u8981\u8D44\u6E90" EnableAddressable: 0 @@ -60,3 +73,16 @@ MonoBehaviour: FilterRuleName: CollectAll AssetTags: UserData: + - GroupName: HotUpdateDll + GroupDesc: + AssetTags: + ActiveRuleName: EnableGroup + Collectors: + - CollectPath: Assets/GameRes/Main/HotUpdateDll + CollectorGUID: 0bd22a8b75fd12a47a8a037cd34776a3 + CollectorType: 0 + AddressRuleName: AddressByFileName + PackRuleName: PackDirectory + FilterRuleName: CollectAll + AssetTags: + UserData: diff --git a/Assets/HybridCLRGenerate/AOTGenericReferences.cs b/Assets/HybridCLRGenerate/AOTGenericReferences.cs index 63774a6..9bffeb3 100644 --- a/Assets/HybridCLRGenerate/AOTGenericReferences.cs +++ b/Assets/HybridCLRGenerate/AOTGenericReferences.cs @@ -5,6 +5,7 @@ public class AOTGenericReferences : UnityEngine.MonoBehaviour // {{ AOT assemblies public static readonly IReadOnlyList PatchedAOTAssemblyList = new List { + "mscorlib.dll", }; // }} @@ -12,6 +13,8 @@ public class AOTGenericReferences : UnityEngine.MonoBehaviour // }} // {{ AOT generic types + // System.Action + // System.Action // }} public void RefMethods() diff --git a/Assets/HybridCLRGenerate/link.xml b/Assets/HybridCLRGenerate/link.xml index 0fa18d4..1651394 100644 --- a/Assets/HybridCLRGenerate/link.xml +++ b/Assets/HybridCLRGenerate/link.xml @@ -1,2 +1,39 @@  - \ No newline at end of file + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Assets/ThirdParty/TextMesh Pro/Resources/Fonts & Materials/AlimamaDongFangDaKai-Regular SDF.asset b/Assets/ThirdParty/TextMesh Pro/Resources/Fonts & Materials/AlimamaDongFangDaKai-Regular SDF.asset index e63cc0a..bc19f7b 100644 --- a/Assets/ThirdParty/TextMesh Pro/Resources/Fonts & Materials/AlimamaDongFangDaKai-Regular SDF.asset +++ b/Assets/ThirdParty/TextMesh Pro/Resources/Fonts & Materials/AlimamaDongFangDaKai-Regular SDF.asset @@ -3005,6 +3005,111 @@ MonoBehaviour: m_XAdvance: 0 m_YAdvance: 0 m_FeatureLookupFlags: 0 + - m_FirstAdjustmentRecord: + m_GlyphIndex: 6892 + m_GlyphValueRecord: + m_XPlacement: 0 + m_YPlacement: 0 + m_XAdvance: 0 + m_YAdvance: 0 + m_SecondAdjustmentRecord: + m_GlyphIndex: 6891 + m_GlyphValueRecord: + m_XPlacement: 0 + m_YPlacement: 0 + m_XAdvance: 0 + m_YAdvance: 0 + m_FeatureLookupFlags: 891490 + - m_FirstAdjustmentRecord: + m_GlyphIndex: 6892 + m_GlyphValueRecord: + m_XPlacement: 0 + m_YPlacement: 0 + m_XAdvance: -1.8000001 + m_YAdvance: 0 + m_SecondAdjustmentRecord: + m_GlyphIndex: 6911 + m_GlyphValueRecord: + m_XPlacement: 0 + m_YPlacement: 0 + m_XAdvance: 0 + m_YAdvance: 0 + m_FeatureLookupFlags: 891490 + - m_FirstAdjustmentRecord: + m_GlyphIndex: 6892 + m_GlyphValueRecord: + m_XPlacement: 0 + m_YPlacement: 0 + m_XAdvance: -1.8000001 + m_YAdvance: 0 + m_SecondAdjustmentRecord: + m_GlyphIndex: 6912 + m_GlyphValueRecord: + m_XPlacement: 0 + m_YPlacement: 0 + m_XAdvance: 0 + m_YAdvance: 0 + m_FeatureLookupFlags: 891490 + - m_FirstAdjustmentRecord: + m_GlyphIndex: 75 + m_GlyphValueRecord: + m_XPlacement: 0 + m_YPlacement: 0 + m_XAdvance: -4.5 + m_YAdvance: 0 + m_SecondAdjustmentRecord: + m_GlyphIndex: 21 + m_GlyphValueRecord: + m_XPlacement: 0 + m_YPlacement: 0 + m_XAdvance: 0 + m_YAdvance: 0 + m_FeatureLookupFlags: 0 + - m_FirstAdjustmentRecord: + m_GlyphIndex: 6954 + m_GlyphValueRecord: + m_XPlacement: 0 + m_YPlacement: 0 + m_XAdvance: 3.6000001 + m_YAdvance: 0 + m_SecondAdjustmentRecord: + m_GlyphIndex: 11 + m_GlyphValueRecord: + m_XPlacement: 0 + m_YPlacement: 0 + m_XAdvance: 0 + m_YAdvance: 0 + m_FeatureLookupFlags: 891490 + - m_FirstAdjustmentRecord: + m_GlyphIndex: 6954 + m_GlyphValueRecord: + m_XPlacement: 0 + m_YPlacement: 0 + m_XAdvance: 3.6000001 + m_YAdvance: 0 + m_SecondAdjustmentRecord: + m_GlyphIndex: 63 + m_GlyphValueRecord: + m_XPlacement: 0 + m_YPlacement: 0 + m_XAdvance: 0 + m_YAdvance: 0 + m_FeatureLookupFlags: 891490 + - m_FirstAdjustmentRecord: + m_GlyphIndex: 76 + m_GlyphValueRecord: + m_XPlacement: 0 + m_YPlacement: 0 + m_XAdvance: -4.5 + m_YAdvance: 0 + m_SecondAdjustmentRecord: + m_GlyphIndex: 21 + m_GlyphValueRecord: + m_XPlacement: 0 + m_YPlacement: 0 + m_XAdvance: 0 + m_YAdvance: 0 + m_FeatureLookupFlags: 0 m_MarkToBaseAdjustmentRecords: [] m_MarkToMarkAdjustmentRecords: [] m_ShouldReimportFontFeatures: 0 diff --git a/ProjectSettings/HybridCLRSettings.asset b/ProjectSettings/HybridCLRSettings.asset new file mode 100644 index 0000000..711c375 --- /dev/null +++ b/ProjectSettings/HybridCLRSettings.asset @@ -0,0 +1,30 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &1 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e189374413a3f00468e49d51d8b27a09, type: 3} + m_Name: + m_EditorClassIdentifier: + enable: 1 + useGlobalIl2cpp: 0 + hybridclrRepoURL: https://gitee.com/focus-creative-games/hybridclr + il2cppPlusRepoURL: https://gitee.com/focus-creative-games/il2cpp_plus + hotUpdateAssemblyDefinitions: + - {fileID: 5897886265953266890, guid: 921b262766d31374c8fd93ad67954b9c, type: 3} + hotUpdateAssemblies: [] + preserveHotUpdateAssemblies: [] + hotUpdateDllCompileOutputRootDir: HybridCLRData/HotUpdateDlls + externalHotUpdateAssembliyDirs: [] + strippedAOTDllOutputRootDir: HybridCLRData/AssembliesPostIl2CppStrip + patchAOTAssemblies: [] + outputLinkFile: HybridCLRGenerate/link.xml + outputAOTGenericReferenceFile: HybridCLRGenerate/AOTGenericReferences.cs + maxGenericReferenceIteration: 10 + maxMethodBridgeGenericIteration: 10