فهرست منبع

Editor工程去掉对Model Hotfix ModelView HotfixView的直接引用

tanghai 4 سال پیش
والد
کامیت
6cb7146ee9

+ 1 - 1
Robot/App/Program.cs

@@ -24,7 +24,7 @@ namespace ET
                 Game.EventSystem.Add(DllHelper.GetHotfixAssembly());
 				
                 ProtobufHelper.Init();
-                MongoHelper.Init();
+                MongoRegister.Init();
 				
                 // 命令行参数
                 Options options = null;

+ 3 - 0
Robot/Model/Robot.Model.csproj

@@ -22,6 +22,9 @@
       <DefineConstants>TRACECOREAPP;NOT_UNITY</DefineConstants>
     </PropertyGroup>
     <ItemGroup>
+        <Compile Include="..\..\Server\Model\Base\MongoRegister.cs">
+          <Link>Base\MongoRegister.cs</Link>
+        </Compile>
         <Compile Include="..\..\Unity\Assets\Editor\Helper\MongoHelper.cs">
           <Link>Base\MongoHelper.cs</Link>
         </Compile>

+ 1 - 1
Server/App/Program.cs

@@ -25,7 +25,7 @@ namespace ET
 				Game.EventSystem.Add(DllHelper.GetHotfixAssembly());
 				
 				ProtobufHelper.Init();
-				MongoHelper.Init();
+				MongoRegister.Init();
 				
 				// 命令行参数
 				Options options = null;

+ 54 - 0
Server/Model/Base/MongoRegister.cs

@@ -0,0 +1,54 @@
+using System;
+using MongoDB.Bson.Serialization;
+using MongoDB.Bson.Serialization.Conventions;
+using UnityEngine;
+
+namespace ET
+{
+    public static class MongoRegister
+    {
+        static MongoRegister()
+        {
+            // 自动注册IgnoreExtraElements
+
+            ConventionPack conventionPack = new ConventionPack { new IgnoreExtraElementsConvention(true) };
+
+            ConventionRegistry.Register("IgnoreExtraElements", conventionPack, type => true);
+
+#if SERVER
+            BsonSerializer.RegisterSerializer(typeof(Vector3), new StructBsonSerialize<Vector3>());
+            BsonSerializer.RegisterSerializer(typeof(Vector4), new StructBsonSerialize<Vector4>());
+            BsonSerializer.RegisterSerializer(typeof(Quaternion), new StructBsonSerialize<Quaternion>());
+#elif ROBOT
+			BsonSerializer.RegisterSerializer(typeof(Quaternion), new StructBsonSerialize<Quaternion>());
+            BsonSerializer.RegisterSerializer(typeof(Vector3), new StructBsonSerialize<Vector3>());
+            BsonSerializer.RegisterSerializer(typeof(Vector4), new StructBsonSerialize<Vector4>());
+#else
+            BsonSerializer.RegisterSerializer(typeof (Vector4), new StructBsonSerialize<Vector4>());
+            BsonSerializer.RegisterSerializer(typeof (Vector3), new StructBsonSerialize<Vector3>());
+#endif
+
+            var types = Game.EventSystem.GetTypes();
+
+            foreach (Type type in types)
+            {
+                if (!type.IsSubclassOf(typeof (Object)))
+                {
+                    continue;
+                }
+
+                if (type.IsGenericType)
+                {
+                    continue;
+                }
+
+                BsonClassMap.LookupClassMap(type);
+            }
+        }
+
+        public static void Init()
+        {
+            
+        }
+    }
+}

+ 4 - 4
Unity/Assets/Editor/BuildEditor/BuildHelper.cs

@@ -51,10 +51,10 @@ namespace ET
                 Directory.CreateDirectory(fold);
             }
 
-            Log.Debug("开始资源打包");
+            UnityEngine.Debug.Log("开始资源打包");
             BuildPipeline.BuildAssetBundles(fold, buildAssetBundleOptions, buildTarget);
 
-            Log.Debug("完成资源打包");
+            UnityEngine.Debug.Log("完成资源打包");
 
             if (isContainAB)
             {
@@ -68,9 +68,9 @@ namespace ET
                 string[] levels = {
                     "Assets/Scenes/Init.unity",
                 };
-                Log.Debug("开始EXE打包");
+                UnityEngine.Debug.Log("开始EXE打包");
                 BuildPipeline.BuildPlayer(levels, $"{relativeDirPrefix}/{exeName}", buildTarget, buildOptions);
-                Log.Debug("完成exe打包");
+                UnityEngine.Debug.Log("完成exe打包");
             }
         }
     }

+ 1 - 1
Unity/Assets/Editor/ComponentViewEditor/ComponentViewEditor.cs

@@ -83,7 +83,7 @@ namespace ET
             }
             catch (Exception e)
             {
-                Log.Error($"component view error: {obj.GetType().FullName} {e}");
+                UnityEngine.Debug.Log($"component view error: {obj.GetType().FullName} {e}");
             }
         }
     }

+ 0 - 43
Unity/Assets/Editor/Helper/MongoHelper.cs

@@ -12,49 +12,6 @@ namespace ET
 {
     public static class MongoHelper
     {
-        static MongoHelper()
-        {
-            // 自动注册IgnoreExtraElements
-
-            ConventionPack conventionPack = new ConventionPack { new IgnoreExtraElementsConvention(true) };
-
-            ConventionRegistry.Register("IgnoreExtraElements", conventionPack, type => true);
-
-#if SERVER
-            BsonSerializer.RegisterSerializer(typeof(Vector3), new StructBsonSerialize<Vector3>());
-            BsonSerializer.RegisterSerializer(typeof(Vector4), new StructBsonSerialize<Vector4>());
-            BsonSerializer.RegisterSerializer(typeof(Quaternion), new StructBsonSerialize<Quaternion>());
-#elif ROBOT
-			BsonSerializer.RegisterSerializer(typeof(Quaternion), new StructBsonSerialize<Quaternion>());
-            BsonSerializer.RegisterSerializer(typeof(Vector3), new StructBsonSerialize<Vector3>());
-            BsonSerializer.RegisterSerializer(typeof(Vector4), new StructBsonSerialize<Vector4>());
-#else
-            BsonSerializer.RegisterSerializer(typeof (Vector4), new StructBsonSerialize<Vector4>());
-            BsonSerializer.RegisterSerializer(typeof (Vector3), new StructBsonSerialize<Vector3>());
-#endif
-
-            var types = Game.EventSystem.GetTypes();
-
-            foreach (Type type in types)
-            {
-                if (!type.IsSubclassOf(typeof (Object)))
-                {
-                    continue;
-                }
-
-                if (type.IsGenericType)
-                {
-                    continue;
-                }
-
-                BsonClassMap.LookupClassMap(type);
-            }
-        }
-
-        public static void Init()
-        {
-        }
-
         public static string ToJson(object obj)
         {
             return obj.ToJson();

+ 1 - 1
Unity/Assets/Editor/RecastNavDataExporter/NavMeshExporter.cs

@@ -739,7 +739,7 @@ namespace ETEditor
                     {
                         string dest = System.IO.Path.Combine(outputServerFolder, name);
                         System.IO.File.Copy(file, dest, true); //复制文件
-                        Log.Debug($"Recast:从{file}复制obj文件到{dest}成功");
+                        UnityEngine.Debug.Log($"Recast:从{file}复制obj文件到{dest}成功");
                     }
                 }
             }

+ 1 - 1
Unity/Assets/Editor/RsyncEditor/RsyncEditor.cs

@@ -83,7 +83,7 @@ namespace ET
 				string arguments =
 						$"-vzrtopg --password-file=./Tools/cwRsync/Config/rsync.secrets --exclude-from=./Tools/cwRsync/Config/exclude.txt --delete ./ {this.rsyncConfig.Account}@{this.rsyncConfig.Host}::Upload/{this.rsyncConfig.RelativePath} --chmod=ugo=rwX";
 				ProcessHelper.Run(@"./Tools/cwRsync/rsync.exe", arguments, @"..\");
-				Log.Debug("同步完成!");
+				UnityEngine.Debug.Log("同步完成!");
 			}
 		}
 	}

+ 0 - 4
Unity/Assets/Editor/Unity.Editor.asmdef

@@ -1,10 +1,6 @@
 {
     "name": "Unity.Editor",
     "references": [
-        "Unity.Model",
-        "Unity.ModelView",
-        "Unity.Hotfix",
-        "Unity.HotfixView",
         "Unity.Mono",
         "ILRuntime"
     ],