Quellcode durchsuchen

创建了Unity.AllModel跟Unity.AllHotfix,想去掉AssemblyBuilder,统一使用IDE编译model跟hotfix
但是跑起来却报了错误,暂时没有找到问题,先放着

tanghai vor 2 Jahren
Ursprung
Commit
0ccc1ed8ce

+ 30 - 0
ET.sln

@@ -55,6 +55,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DotNet.Loader", "DotNet\Loa
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Unity.AllCodes", "Unity\Unity.AllCodes.csproj", "{BC8AF236-3AA6-2FE6-DCCB-E412FEC3C152}"
 EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Unity.AllModel", "Unity\Unity.AllModel.csproj", "{B274D5FA-24BE-0EF2-8374-77D88F882F8D}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Unity.AllHotfix", "Unity\Unity.AllHotfix.csproj", "{152061A0-80F4-0ADA-C8E3-F8EAEC23405A}"
+EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 		Debug|Any CPU = Debug|Any CPU
@@ -329,6 +333,30 @@ Global
 		{BC8AF236-3AA6-2FE6-DCCB-E412FEC3C152}.Release|x64.Build.0 = Debug|Any CPU
 		{BC8AF236-3AA6-2FE6-DCCB-E412FEC3C152}.Release|x86.ActiveCfg = Debug|Any CPU
 		{BC8AF236-3AA6-2FE6-DCCB-E412FEC3C152}.Release|x86.Build.0 = Debug|Any CPU
+		{B274D5FA-24BE-0EF2-8374-77D88F882F8D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{B274D5FA-24BE-0EF2-8374-77D88F882F8D}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{B274D5FA-24BE-0EF2-8374-77D88F882F8D}.Debug|x64.ActiveCfg = Debug|Any CPU
+		{B274D5FA-24BE-0EF2-8374-77D88F882F8D}.Debug|x64.Build.0 = Debug|Any CPU
+		{B274D5FA-24BE-0EF2-8374-77D88F882F8D}.Debug|x86.ActiveCfg = Debug|Any CPU
+		{B274D5FA-24BE-0EF2-8374-77D88F882F8D}.Debug|x86.Build.0 = Debug|Any CPU
+		{B274D5FA-24BE-0EF2-8374-77D88F882F8D}.Release|Any CPU.ActiveCfg = Debug|Any CPU
+		{B274D5FA-24BE-0EF2-8374-77D88F882F8D}.Release|Any CPU.Build.0 = Debug|Any CPU
+		{B274D5FA-24BE-0EF2-8374-77D88F882F8D}.Release|x64.ActiveCfg = Debug|Any CPU
+		{B274D5FA-24BE-0EF2-8374-77D88F882F8D}.Release|x64.Build.0 = Debug|Any CPU
+		{B274D5FA-24BE-0EF2-8374-77D88F882F8D}.Release|x86.ActiveCfg = Debug|Any CPU
+		{B274D5FA-24BE-0EF2-8374-77D88F882F8D}.Release|x86.Build.0 = Debug|Any CPU
+		{152061A0-80F4-0ADA-C8E3-F8EAEC23405A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{152061A0-80F4-0ADA-C8E3-F8EAEC23405A}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{152061A0-80F4-0ADA-C8E3-F8EAEC23405A}.Debug|x64.ActiveCfg = Debug|Any CPU
+		{152061A0-80F4-0ADA-C8E3-F8EAEC23405A}.Debug|x64.Build.0 = Debug|Any CPU
+		{152061A0-80F4-0ADA-C8E3-F8EAEC23405A}.Debug|x86.ActiveCfg = Debug|Any CPU
+		{152061A0-80F4-0ADA-C8E3-F8EAEC23405A}.Debug|x86.Build.0 = Debug|Any CPU
+		{152061A0-80F4-0ADA-C8E3-F8EAEC23405A}.Release|Any CPU.ActiveCfg = Debug|Any CPU
+		{152061A0-80F4-0ADA-C8E3-F8EAEC23405A}.Release|Any CPU.Build.0 = Debug|Any CPU
+		{152061A0-80F4-0ADA-C8E3-F8EAEC23405A}.Release|x64.ActiveCfg = Debug|Any CPU
+		{152061A0-80F4-0ADA-C8E3-F8EAEC23405A}.Release|x64.Build.0 = Debug|Any CPU
+		{152061A0-80F4-0ADA-C8E3-F8EAEC23405A}.Release|x86.ActiveCfg = Debug|Any CPU
+		{152061A0-80F4-0ADA-C8E3-F8EAEC23405A}.Release|x86.Build.0 = Debug|Any CPU
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE
@@ -357,6 +385,8 @@ Global
 		{9498BFB4-D9F5-C441-13E3-3F26F7700E29} = {914C77C9-212A-4DD0-8D9A-074620E77FAA}
 		{C109842F-01DA-64D4-DBF2-00C6449E459E} = {914C77C9-212A-4DD0-8D9A-074620E77FAA}
 		{BC8AF236-3AA6-2FE6-DCCB-E412FEC3C152} = {914C77C9-212A-4DD0-8D9A-074620E77FAA}
+		{B274D5FA-24BE-0EF2-8374-77D88F882F8D} = {914C77C9-212A-4DD0-8D9A-074620E77FAA}
+		{152061A0-80F4-0ADA-C8E3-F8EAEC23405A} = {914C77C9-212A-4DD0-8D9A-074620E77FAA}
 	EndGlobalSection
 	GlobalSection(ExtensibilityGlobals) = postSolution
 		SolutionGuid = {EABC01E3-3EB5-47EF-B46E-AAD8BB3585F1}

+ 1 - 0
Unity/Assets/Scripts/Core/Serialize/SerializeHelper.cs

@@ -7,6 +7,7 @@ namespace ET
 {
     public static class SerializeHelper
 	{
+		// 这里不用宏控制,因为服务端也要用,如果用宏,需要同时在服务端客户端加宏,挺麻烦的,不如直接在这里改代码
 		public const bool UseMemoryPack = true;
 		
 		public static object Deserialize(Type type, byte[] bytes, int index, int count)

+ 51 - 1
Unity/Assets/Scripts/Editor/AssetPostProcessor/OnGenerateCSProjectProcessor.cs

@@ -76,10 +76,49 @@ namespace ET
                         @"Assets\Scripts\Codes\ModelView\**\*.cs %(RecursiveDir)%(FileName)%(Extension)");
                 }
                 
+                if (path.EndsWith("Unity.AllModel.csproj"))
+                {
+                    content = content.Replace("<Compile Include=\"Assets\\Scripts\\Empty\\AllModel\\Empty.cs\" />", string.Empty);
+                    content = content.Replace("<None Include=\"Assets\\Scripts\\Empty\\AllModel\\Unity.AllModel.asmdef\" />", string.Empty);
+
+                    content = GenerateCustomProject(path, content,
+                        @"Assets\Scripts\Codes\Model\Server\**\*.cs Server\%(RecursiveDir)%(FileName)%(Extension)",
+                        @"Assets\Scripts\Codes\Model\Client\**\*.cs Client\%(RecursiveDir)%(FileName)%(Extension)",
+                        @"Assets\Scripts\Codes\Model\Share\**\*.cs Share\%(RecursiveDir)%(FileName)%(Extension)",
+                        @"Assets\Scripts\Codes\Model\Generate\ClientServer\**\*.cs Generate\%(RecursiveDir)%(FileName)%(Extension)",
+                        @"Assets\Scripts\Codes\ModelView\**\*.cs %(RecursiveDir)%(FileName)%(Extension)"
+                        );
+                    content = content.Replace("<Target Name=\"AfterBuild\" />",
+                        "   <Target Name=\"AfterBuild\">\n" +
+                        $"       <Copy SourceFiles=\"$(TargetDir)/$(TargetName).dll\" DestinationFiles=\"$(ProjectDir)/{Define.CodeDir}/Model.dll.bytes\" ContinueOnError=\"false\" />\n" +
+                        $"       <Copy SourceFiles=\"$(TargetDir)/$(TargetName).pdb\" DestinationFiles=\"$(ProjectDir)/{Define.CodeDir}/Model.pdb.bytes\" ContinueOnError=\"false\" />\n" +
+                        $"       <Copy SourceFiles=\"$(TargetDir)/$(TargetName).dll\" DestinationFiles=\"$(ProjectDir)/{Define.BuildOutputDir}/Model.dll\" ContinueOnError=\"false\" />\n" +
+                        $"       <Copy SourceFiles=\"$(TargetDir)/$(TargetName).pdb\" DestinationFiles=\"$(ProjectDir)/{Define.BuildOutputDir}/Model.pdb\" ContinueOnError=\"false\" />\n" +
+                        "   </Target>\n");
+                }
+                
+                if (path.EndsWith("Unity.AllHotfix.csproj"))
+                {
+                    content = content.Replace("<Compile Include=\"Assets\\Scripts\\Empty\\AllHotfix\\Empty.cs\" />", string.Empty);
+                    content = content.Replace("<None Include=\"Assets\\Scripts\\Empty\\AllHotfix\\Unity.AllHotfix.asmdef\" />", string.Empty);
+
+                    content = GenerateCustomProject(path, content,
+                        @"Assets\Scripts\Codes\Hotfix\**\*.cs %(RecursiveDir)%(FileName)%(Extension)",
+                        @"Assets\Scripts\Codes\HotfixView\**\*.cs %(RecursiveDir)%(FileName)%(Extension)"
+                        );
+                    content = content.Replace("<Target Name=\"AfterBuild\" />",
+                        "   <Target Name=\"AfterBuild\">\n" +
+                        $"       <Copy SourceFiles=\"$(TargetDir)/$(TargetName).dll\" DestinationFiles=\"$(ProjectDir)/{Define.CodeDir}/Hotfix.dll.bytes\" ContinueOnError=\"false\" />\n" +
+                        $"       <Copy SourceFiles=\"$(TargetDir)/$(TargetName).pdb\" DestinationFiles=\"$(ProjectDir)/{Define.CodeDir}/Hotfix.pdb.bytes\" ContinueOnError=\"false\" />\n" +
+                        $"       <Copy SourceFiles=\"$(TargetDir)/$(TargetName).dll\" DestinationFiles=\"$(ProjectDir)/{Define.BuildOutputDir}/Hotfix.dll\" ContinueOnError=\"false\" />\n" +
+                        $"       <Copy SourceFiles=\"$(TargetDir)/$(TargetName).pdb\" DestinationFiles=\"$(ProjectDir)/{Define.BuildOutputDir}/Hotfix.pdb\" ContinueOnError=\"false\" />\n" +
+                        "   </Target>\n");
+                }
+                
                 if (path.EndsWith("Unity.AllCodes.csproj"))
                 {
                     content = content.Replace("<Compile Include=\"Assets\\Scripts\\Empty\\AllCodes\\Empty.cs\" />", string.Empty);
-                    content = content.Replace("<None Include=\"Assets\\Scripts\\Empty\\Hotfix\\Unity.AllCodes.asmdef\" />", string.Empty);
+                    content = content.Replace("<None Include=\"Assets\\Scripts\\Empty\\AllCodes\\Unity.AllCodes.asmdef\" />", string.Empty);
 
                     content = GenerateCustomProject(path, content,
                         @"Assets\Scripts\Codes\Model\Server\**\*.cs Server\%(RecursiveDir)%(FileName)%(Extension)",
@@ -90,6 +129,13 @@ namespace ET
                         @"Assets\Scripts\Codes\ModelView\**\*.cs %(RecursiveDir)%(FileName)%(Extension)",
                         @"Assets\Scripts\Codes\HotfixView\**\*.cs %(RecursiveDir)%(FileName)%(Extension)"
                         );
+                    content = content.Replace("<Target Name=\"AfterBuild\" />",
+                        "   <Target Name=\"AfterBuild\">\n" +
+                        $"       <Copy SourceFiles=\"$(TargetDir)/$(TargetName).dll\" DestinationFiles=\"$(ProjectDir)/{Define.CodeDir}/Model.dll.bytes\" ContinueOnError=\"false\" />\n" +
+                        $"       <Copy SourceFiles=\"$(TargetDir)/$(TargetName).pdb\" DestinationFiles=\"$(ProjectDir)/{Define.CodeDir}/Model.pdb.bytes\" ContinueOnError=\"false\" />\n" +
+                        $"       <Copy SourceFiles=\"$(TargetDir)/$(TargetName).dll\" DestinationFiles=\"$(ProjectDir)/{Define.BuildOutputDir}/Model.dll\" ContinueOnError=\"false\" />\n" +
+                        $"       <Copy SourceFiles=\"$(TargetDir)/$(TargetName).pdb\" DestinationFiles=\"$(ProjectDir)/{Define.BuildOutputDir}/Model.pdb\" ContinueOnError=\"false\" />\n" +
+                        "   </Target>\n");
                 }
             }
             return content;
@@ -104,6 +150,10 @@ namespace ET
 
             var rootNode = newDoc.GetElementsByTagName("Project")[0];
 
+            var target = newDoc.CreateElement("Target", newDoc.DocumentElement.NamespaceURI);
+            target.SetAttribute("Name", "AfterBuild");
+            rootNode.AppendChild(target);
+
             XmlElement itemGroup = newDoc.CreateElement("ItemGroup", newDoc.DocumentElement.NamespaceURI);
             foreach (var s in links)
             {

+ 4 - 6
Unity/Assets/Scripts/Editor/BuildEditor/BuildAssembliesHelper.cs

@@ -11,8 +11,6 @@ namespace ET
 {
     public static class BuildAssembliesHelper
     {
-        public const string CodeDir = "Assets/Bundles/Code/";
-
         public static void BuildModel(CodeOptimization codeOptimization, GlobalConfig globalConfig)
         {
             List<string> codes;
@@ -53,8 +51,8 @@ namespace ET
 
             BuildAssembliesHelper.BuildMuteAssembly("Model", codes, Array.Empty<string>(), codeOptimization, globalConfig.CodeMode);
 
-            File.Copy(Path.Combine(Define.BuildOutputDir, $"Model.dll"), Path.Combine(CodeDir, $"Model.dll.bytes"), true);
-            File.Copy(Path.Combine(Define.BuildOutputDir, $"Model.pdb"), Path.Combine(CodeDir, $"Model.pdb.bytes"), true);
+            File.Copy(Path.Combine(Define.BuildOutputDir, $"Model.dll"), Path.Combine(Define.CodeDir, $"Model.dll.bytes"), true);
+            File.Copy(Path.Combine(Define.BuildOutputDir, $"Model.pdb"), Path.Combine(Define.CodeDir, $"Model.pdb.bytes"), true);
             Debug.Log("copy Model.dll to Bundles/Code success!");
         }
 
@@ -102,8 +100,8 @@ namespace ET
             BuildAssembliesHelper.BuildMuteAssembly("Hotfix", codes, new[] { Path.Combine(Define.BuildOutputDir, "Model.dll") }, codeOptimization,
                 globalConfig.CodeMode);
 
-            File.Copy(Path.Combine(Define.BuildOutputDir, "Hotfix.dll"), Path.Combine(CodeDir, $"Hotfix.dll.bytes"), true);
-            File.Copy(Path.Combine(Define.BuildOutputDir, "Hotfix.pdb"), Path.Combine(CodeDir, $"Hotfix.pdb.bytes"), true);
+            File.Copy(Path.Combine(Define.BuildOutputDir, "Hotfix.dll"), Path.Combine(Define.CodeDir, $"Hotfix.dll.bytes"), true);
+            File.Copy(Path.Combine(Define.BuildOutputDir, "Hotfix.pdb"), Path.Combine(Define.CodeDir, $"Hotfix.pdb.bytes"), true);
             File.Copy(Path.Combine(Define.BuildOutputDir, "Hotfix.dll"), Path.Combine(Define.BuildOutputDir, $"{logicFile}.dll"), true);
             File.Copy(Path.Combine(Define.BuildOutputDir, "Hotfix.pdb"), Path.Combine(Define.BuildOutputDir, $"{logicFile}.pdb"), true);
             Debug.Log("copy Hotfix.dll to Bundles/Code success!");

+ 15 - 1
Unity/Assets/Scripts/Editor/BuildEditor/BuildEditor.cs

@@ -7,6 +7,7 @@ using UnityEditor;
 using UnityEditor.Compilation;
 using UnityEngine;
 using Debug = UnityEngine.Debug;
+#pragma warning disable CS0162
 
 namespace ET
 {
@@ -129,6 +130,11 @@ namespace ET
 				{
 					throw new Exception("now in ENABLE_CODES mode, do not need Build!");
 				}
+				if (SerializeHelper.UseMemoryPack)
+				{
+					throw new Exception("now in UseMemoryPack mode, you should use ide Build Unity.AllCodes project!");
+				}
+				
 				BuildAssembliesHelper.BuildModel(this.codeOptimization, globalConfig);
 				BuildAssembliesHelper.BuildHotfix(this.codeOptimization, globalConfig);
 
@@ -143,6 +149,10 @@ namespace ET
 				{
 					throw new Exception("now in ENABLE_CODES mode, do not need Build!");
 				}
+				if (SerializeHelper.UseMemoryPack)
+				{
+					throw new Exception("now in UseMemoryPack mode, you should use ide Build Unity.AllCodes project!");
+				}
 				BuildAssembliesHelper.BuildModel(this.codeOptimization, globalConfig);
 
 				AfterCompiling();
@@ -156,6 +166,10 @@ namespace ET
 				{
 					throw new Exception("now in ENABLE_CODES mode, do not need Build!");
 				}
+				if (SerializeHelper.UseMemoryPack)
+				{
+					throw new Exception("now in UseMemoryPack mode, you should use ide Build Unity.AllCodes project!");
+				}
 				BuildAssembliesHelper.BuildHotfix(this.codeOptimization, globalConfig);
 
 				AfterCompiling();
@@ -185,7 +199,7 @@ namespace ET
 		
 		private static void AfterCompiling()
 		{
-			Directory.CreateDirectory(BuildAssembliesHelper.CodeDir);
+			Directory.CreateDirectory(Define.CodeDir);
 
 			// 设置ab包
 			AssetImporter assetImporter = AssetImporter.GetAtPath("Assets/Bundles/Code");

+ 8 - 0
Unity/Assets/Scripts/Empty/AllHotfix.meta

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 145d237b357c142828a4367b157bd2a0
+folderAsset: yes
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 1 - 0
Unity/Assets/Scripts/Empty/AllHotfix/Empty.cs

@@ -0,0 +1 @@
+//用于自动生成工程项目的占位脚本,请勿移除或修改

+ 11 - 0
Unity/Assets/Scripts/Empty/AllHotfix/Empty.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 40691c691d6f84e41baccfa582995eef
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 21 - 0
Unity/Assets/Scripts/Empty/AllHotfix/Unity.AllHotfix.asmdef

@@ -0,0 +1,21 @@
+{
+    "name": "Unity.AllHotfix",
+    "rootNamespace": "ET",
+    "references": [
+        "Unity.AllModel",
+        "Unity.ThirdParty",
+        "Unity.Core",
+        "Unity.Mathematics",
+        "Unity.Loader",
+        "MemoryPack"
+    ],
+    "includePlatforms": [],
+    "excludePlatforms": [],
+    "allowUnsafeCode": true,
+    "overrideReferences": false,
+    "precompiledReferences": [],
+    "autoReferenced": true,
+    "defineConstraints": [],
+    "versionDefines": [],
+    "noEngineReferences": false
+}

+ 7 - 0
Unity/Assets/Scripts/Empty/AllHotfix/Unity.AllHotfix.asmdef.meta

@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: 4d44f3e295a424180985a9e3b669a622
+AssemblyDefinitionImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 8 - 0
Unity/Assets/Scripts/Empty/AllModel.meta

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: d9047ea8e8abb4acfa9b45893fc26a62
+folderAsset: yes
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 1 - 0
Unity/Assets/Scripts/Empty/AllModel/Empty.cs

@@ -0,0 +1 @@
+//用于自动生成工程项目的占位脚本,请勿移除或修改

+ 11 - 0
Unity/Assets/Scripts/Empty/AllModel/Empty.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: f4b3e914665ac483faa99a65622465b8
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 20 - 0
Unity/Assets/Scripts/Empty/AllModel/Unity.AllModel.asmdef

@@ -0,0 +1,20 @@
+{
+    "name": "Unity.AllModel",
+    "rootNamespace": "ET",
+    "references": [
+        "Unity.ThirdParty",
+        "Unity.Core",
+        "Unity.Mathematics",
+        "MemoryPack",
+        "Unity.Loader"
+    ],
+    "includePlatforms": [],
+    "excludePlatforms": [],
+    "allowUnsafeCode": true,
+    "overrideReferences": false,
+    "precompiledReferences": [],
+    "autoReferenced": true,
+    "defineConstraints": [],
+    "versionDefines": [],
+    "noEngineReferences": false
+}

+ 7 - 0
Unity/Assets/Scripts/Empty/AllModel/Unity.AllModel.asmdef.meta

@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: 2c6a2532a636647e5b38390decca9791
+AssemblyDefinitionImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 5 - 10
Unity/Assets/Scripts/Loader/CodeLoader.cs

@@ -50,16 +50,8 @@ namespace ET
 				}
 				else
 				{
-					if (SerializeHelper.UseMemoryPack)
-					{
-						assBytes = File.ReadAllBytes(Path.Combine(Define.BuildOutputDir, "Unity.AllCodes", "Unity.AllCodes.dll"));
-						pdbBytes = File.ReadAllBytes(Path.Combine(Define.BuildOutputDir, "Unity.AllCodes", "Unity.AllCodes.pdb"));
-					}
-					else
-					{
-						assBytes = File.ReadAllBytes(Path.Combine(Define.BuildOutputDir, "Model.dll"));
-						pdbBytes = File.ReadAllBytes(Path.Combine(Define.BuildOutputDir, "Model.pdb"));
-					}
+					assBytes = File.ReadAllBytes(Path.Combine(Define.BuildOutputDir, "Model.dll"));
+					pdbBytes = File.ReadAllBytes(Path.Combine(Define.BuildOutputDir, "Model.pdb"));
 				}
 			
 				this.model = Assembly.Load(assBytes, pdbBytes);
@@ -100,6 +92,9 @@ namespace ET
 				string logicName = Path.GetFileNameWithoutExtension(logicFiles[0]);
 				assBytes = File.ReadAllBytes(Path.Combine(Define.BuildOutputDir, $"{logicName}.dll"));
 				pdbBytes = File.ReadAllBytes(Path.Combine(Define.BuildOutputDir, $"{logicName}.pdb"));
+				
+				//assBytes = File.ReadAllBytes(Path.Combine(Define.BuildOutputDir, "Hotfix.dll"));
+				//pdbBytes = File.ReadAllBytes(Path.Combine(Define.BuildOutputDir, "Hotfix.pdb"));
 			}
 
 			Assembly hotfixAssembly = Assembly.Load(assBytes, pdbBytes);

+ 2 - 3
Unity/Assets/Scripts/Loader/Define.cs

@@ -2,9 +2,8 @@
 {
 	public static class Define
 	{
-		public const string BuildOutputDir = "./Temp/Bin/Debug";
-
-		public const bool UseMemoryPack = false;
+		public const string CodeDir = "Assets/Bundles/Code/";
+		public const string BuildOutputDir = "Temp/Bin/Debug";
 
 #if UNITY_EDITOR && !ASYNC
 		public static bool IsAsync = false;

+ 7 - 0
Unity/Unity.AllCodes.csproj

@@ -769,6 +769,13 @@
   <Target Name="AfterBuild">
   </Target>
   -->
+     <Target Name="AfterBuild">
+       <Copy SourceFiles="$(TargetDir)/$(TargetName).dll" DestinationFiles="$(ProjectDir)/Assets/Bundles/Code//Model.dll.bytes" ContinueOnError="false" />
+       <Copy SourceFiles="$(TargetDir)/$(TargetName).pdb" DestinationFiles="$(ProjectDir)/Assets/Bundles/Code//Model.pdb.bytes" ContinueOnError="false" />
+       <Copy SourceFiles="$(TargetDir)/$(TargetName).dll" DestinationFiles="$(ProjectDir)/Temp/Bin/Debug/Model.dll" ContinueOnError="false" />
+       <Copy SourceFiles="$(TargetDir)/$(TargetName).pdb" DestinationFiles="$(ProjectDir)/Temp/Bin/Debug/Model.pdb" ContinueOnError="false" />
+   </Target>
+
   <ItemGroup>
     <Compile Include="Assets\Scripts\Codes\Model\Server\**\*.cs">
       <Link>Server\%(RecursiveDir)%(FileName)%(Extension)</Link>

Datei-Diff unterdrückt, da er zu groß ist
+ 28 - 0
Unity/Unity.AllHotfix.csproj


Datei-Diff unterdrückt, da er zu groß ist
+ 28 - 0
Unity/Unity.AllModel.csproj


Einige Dateien werden nicht angezeigt, da zu viele Dateien in diesem Diff geändert wurden.