Просмотр исходного кода

增加配置组件,可以加载json格式的配置

tanghai 8 лет назад
Родитель
Сommit
7f1769512a
51 измененных файлов с 166 добавлено и 55 удалено
  1. BIN
      Config/BuffConfig.txt
  2. 2 0
      Server/App/Program.cs
  3. 0 0
      Server/Model/Base/Config/ACategory.cs
  4. 0 0
      Server/Model/Base/Config/AConfig.cs
  5. 0 0
      Server/Model/Base/Config/AConfigComponent.cs
  6. 0 0
      Server/Model/Base/Config/ConfigAttribute.cs
  7. 3 3
      Server/Model/Base/Config/ConfigHelper.cs
  8. 0 0
      Server/Model/Base/Config/ICategory.cs
  9. 0 0
      Server/Model/Base/Event/AEventAttribute.cs
  10. 0 0
      Server/Model/Base/Event/Env.cs
  11. 0 0
      Server/Model/Base/Event/EnvKey.cs
  12. 0 0
      Server/Model/Base/Event/EventAttribute.cs
  13. 0 0
      Server/Model/Base/Event/EventIdType.cs
  14. 0 0
      Server/Model/Base/Event/IEvent.cs
  15. 0 0
      Server/Model/Base/Helper/DllHelper.cs
  16. 0 0
      Server/Model/Base/Message/AActorMessage.cs
  17. 0 0
      Server/Model/Base/Message/AMActorHandler.cs
  18. 0 0
      Server/Model/Base/Message/AMRpcHandler.cs
  19. 0 0
      Server/Model/Base/Message/AMessage.cs
  20. 0 0
      Server/Model/Base/Message/ActorMessageAttribute.cs
  21. 0 0
      Server/Model/Base/Message/ActorMessageHandlerAttribute.cs
  22. 0 0
      Server/Model/Base/Message/ErrorCode.cs
  23. 0 0
      Server/Model/Base/Message/IEntityActorHandler.cs
  24. 0 0
      Server/Model/Base/Message/IMActorHandler.cs
  25. 0 0
      Server/Model/Base/Message/IMHandler.cs
  26. 0 0
      Server/Model/Base/Message/InnerMessageDispatcher.cs
  27. 0 0
      Server/Model/Base/Message/MessageAttribute.cs
  28. 0 0
      Server/Model/Base/Message/MessageHandlerAttribute.cs
  29. 0 0
      Server/Model/Base/Message/OpcodeHelper.cs
  30. 0 0
      Server/Model/Base/Message/OuterMessageDispatcher.cs
  31. 0 0
      Server/Model/Base/Object/ComponentDB.cs
  32. 0 0
      Server/Model/Base/Object/EntityType.cs
  33. 0 0
      Server/Model/Base/Object/ObjectEvents.cs
  34. 1 1
      Server/Model/Entity/Config/BuffConfig.cs
  35. 34 32
      Server/Model/Server.Model.csproj
  36. 9 0
      Unity/Assets/Res/Config.meta
  37. BIN
      Unity/Assets/Res/Config/BuffConfig.txt
  38. 8 0
      Unity/Assets/Res/Config/BuffConfig.txt.meta
  39. 56 0
      Unity/Assets/Resources/Config.prefab
  40. 8 0
      Unity/Assets/Resources/Config.prefab.meta
  41. 2 2
      Unity/Assets/Scripts/Base/Object/Entity.cs
  42. 26 11
      Unity/Assets/Scripts/Component/ConfigComponent.cs
  43. 3 0
      Unity/Assets/Scripts/Component/ConfigComponent.cs.meta
  44. 9 0
      Unity/Assets/Scripts/Init.cs
  45. 0 0
      Unity/Assets/Scripts/MonoConfig.meta
  46. 0 0
      Unity/Assets/Scripts/MonoConfig/CanvasConfig.cs
  47. 0 0
      Unity/Assets/Scripts/MonoConfig/CanvasConfig.cs.meta
  48. 0 5
      Unity/Hotfix/Init.cs
  49. 1 0
      Unity/Unity.Editor.csproj
  50. 1 0
      Unity/Unity.Plugins.csproj
  51. 3 1
      Unity/Unity.csproj

BIN
Config/BuffConfig.txt


+ 2 - 0
Server/App/Program.cs

@@ -91,6 +91,8 @@ namespace App
 						Game.Scene.AddComponent<AppManagerComponent>();
 						Game.Scene.AddComponent<RealmGateAddressComponent>();
 						Game.Scene.AddComponent<GateSessionKeyComponent>();
+						Game.Scene.AddComponent<ConfigComponent>();
+						Log.Debug(Game.Scene.GetComponent<ConfigComponent>().Get<BuffConfig>(1).Name);
 						break;
 					case AppType.Benchmark:
 						Game.Scene.AddComponent<NetOuterComponent>();

+ 0 - 0
Server/Model/Config/ACategory.cs → Server/Model/Base/Config/ACategory.cs


+ 0 - 0
Server/Model/Config/AConfig.cs → Server/Model/Base/Config/AConfig.cs


+ 0 - 0
Server/Model/Config/AConfigComponent.cs → Server/Model/Base/Config/AConfigComponent.cs


+ 0 - 0
Server/Model/Config/ConfigAttribute.cs → Server/Model/Base/Config/ConfigAttribute.cs


+ 3 - 3
Server/Model/Config/ConfigHelper.cs → Server/Model/Base/Config/ConfigHelper.cs

@@ -7,15 +7,15 @@ namespace Model
 	{
 		public static string GetText(string key)
 		{
-			string path = $@"../Config/{key}.txt";
+			string path = $"../Config/{key}.txt";
 			try
 			{
 				string configStr = File.ReadAllText(path);
 				return configStr;
 			}
-			catch (Exception)
+			catch (Exception e)
 			{
-				throw new Exception($"load config file fail, path: {path}");
+				throw new Exception($"load config file fail, path: {path} {e}");
 			}
 		}
 	}

+ 0 - 0
Server/Model/Config/ICategory.cs → Server/Model/Base/Config/ICategory.cs


+ 0 - 0
Server/Model/Event/AEventAttribute.cs → Server/Model/Base/Event/AEventAttribute.cs


+ 0 - 0
Server/Model/Event/Env.cs → Server/Model/Base/Event/Env.cs


+ 0 - 0
Server/Model/Event/EnvKey.cs → Server/Model/Base/Event/EnvKey.cs


+ 0 - 0
Server/Model/Event/EventAttribute.cs → Server/Model/Base/Event/EventAttribute.cs


+ 0 - 0
Server/Model/Event/EventIdType.cs → Server/Model/Base/Event/EventIdType.cs


+ 0 - 0
Server/Model/Event/IEvent.cs → Server/Model/Base/Event/IEvent.cs


+ 0 - 0
Server/Model/Helper/DllHelper.cs → Server/Model/Base/Helper/DllHelper.cs


+ 0 - 0
Server/Model/Message/AActorMessage.cs → Server/Model/Base/Message/AActorMessage.cs


+ 0 - 0
Server/Model/Message/AMActorHandler.cs → Server/Model/Base/Message/AMActorHandler.cs


+ 0 - 0
Server/Model/Message/AMRpcHandler.cs → Server/Model/Base/Message/AMRpcHandler.cs


+ 0 - 0
Server/Model/Message/AMessage.cs → Server/Model/Base/Message/AMessage.cs


+ 0 - 0
Server/Model/Message/ActorMessageAttribute.cs → Server/Model/Base/Message/ActorMessageAttribute.cs


+ 0 - 0
Server/Model/Message/ActorMessageHandlerAttribute.cs → Server/Model/Base/Message/ActorMessageHandlerAttribute.cs


+ 0 - 0
Server/Model/Message/ErrorCode.cs → Server/Model/Base/Message/ErrorCode.cs


+ 0 - 0
Server/Model/Message/IEntityActorHandler.cs → Server/Model/Base/Message/IEntityActorHandler.cs


+ 0 - 0
Server/Model/Message/IMActorHandler.cs → Server/Model/Base/Message/IMActorHandler.cs


+ 0 - 0
Server/Model/Message/IMHandler.cs → Server/Model/Base/Message/IMHandler.cs


+ 0 - 0
Server/Model/Message/InnerMessageDispatcher.cs → Server/Model/Base/Message/InnerMessageDispatcher.cs


+ 0 - 0
Server/Model/Message/MessageAttribute.cs → Server/Model/Base/Message/MessageAttribute.cs


+ 0 - 0
Server/Model/Message/MessageHandlerAttribute.cs → Server/Model/Base/Message/MessageHandlerAttribute.cs


+ 0 - 0
Server/Model/Message/OpcodeHelper.cs → Server/Model/Base/Message/OpcodeHelper.cs


+ 0 - 0
Server/Model/Message/OuterMessageDispatcher.cs → Server/Model/Base/Message/OuterMessageDispatcher.cs


+ 0 - 0
Server/Model/Object/ComponentDB.cs → Server/Model/Base/Object/ComponentDB.cs


+ 0 - 0
Server/Model/Object/EntityType.cs → Server/Model/Base/Object/EntityType.cs


+ 0 - 0
Server/Model/Object/ObjectEvents.cs → Server/Model/Base/Object/ObjectEvents.cs


+ 1 - 1
Server/Model/Entity/Config/BuffConfig.cs

@@ -6,7 +6,7 @@ namespace Model
 	public class BuffConfig: AConfig
 	{
 		public string Name { get; set; }
-		public int Time { get; set; }
+		public int Duration { get; set; }
 
 		public BuffConfig()
 		{

+ 34 - 32
Server/Model/Server.Model.csproj

@@ -109,6 +109,9 @@
     <Compile Include="..\..\Unity\Assets\Scripts\Base\Object\ObjectEventAttribute.cs">
       <Link>Object\ObjectEventAttribute.cs</Link>
     </Compile>
+    <Compile Include="..\..\Unity\Assets\Scripts\Component\ConfigComponent.cs">
+      <Link>Component\ConfigComponent.cs</Link>
+    </Compile>
     <Compile Include="..\..\Unity\Assets\Scripts\Component\EventComponent.cs">
       <Link>Component\EventComponent.cs</Link>
     </Compile>
@@ -135,12 +138,11 @@
     <Compile Include="Component\Unit\UnitGateComponent.cs" />
     <Compile Include="Entity\Player.cs" />
     <Compile Include="Entity\Location.cs" />
-    <Compile Include="Message\AMRpcHandler.cs" />
-    <Compile Include="Message\IEntityActorHandler.cs" />
+    <Compile Include="Base\Message\AMRpcHandler.cs" />
+    <Compile Include="Base\Message\IEntityActorHandler.cs" />
     <Compile Include="Component\OpcodeTypeComponent.cs" />
     <Compile Include="Component\ActorManagerComponent.cs" />
     <Compile Include="Component\BenchmarkComponent.cs" />
-    <Compile Include="Component\ConfigComponent.cs" />
     <Compile Include="Component\Config\ClientConfig.cs" />
     <Compile Include="Component\Config\DBConfig.cs" />
     <Compile Include="Component\Config\HttpConfig.cs" />
@@ -168,12 +170,12 @@
     <Compile Include="Component\RealmGateAddressComponent.cs" />
     <Compile Include="Component\OptionComponent.cs" />
     <Compile Include="Component\StartConfigComponent.cs" />
-    <Compile Include="Config\ACategory.cs" />
-    <Compile Include="Config\AConfig.cs" />
-    <Compile Include="Config\AConfigComponent.cs" />
-    <Compile Include="Config\ConfigAttribute.cs" />
-    <Compile Include="Config\ConfigHelper.cs" />
-    <Compile Include="Config\ICategory.cs" />
+    <Compile Include="Base\Config\ACategory.cs" />
+    <Compile Include="Base\Config\AConfig.cs" />
+    <Compile Include="Base\Config\AConfigComponent.cs" />
+    <Compile Include="Base\Config\ConfigAttribute.cs" />
+    <Compile Include="Base\Config\ConfigHelper.cs" />
+    <Compile Include="Base\Config\ICategory.cs" />
     <Compile Include="Entity\Config\BuffConfig.cs" />
     <Compile Include="Entity\Config\StartConfig.cs" />
     <Compile Include="Entity\ActorProxy.cs" />
@@ -187,29 +189,29 @@
     <Compile Include="Entity\Message\InnerOpcode.cs" />
     <Compile Include="Entity\Scene.cs" />
     <Compile Include="Entity\Unit.cs" />
-    <Compile Include="Event\AEventAttribute.cs" />
-    <Compile Include="Event\Env.cs" />
-    <Compile Include="Event\EnvKey.cs" />
-    <Compile Include="Event\EventAttribute.cs" />
-    <Compile Include="Event\EventIdType.cs" />
-    <Compile Include="Event\IEvent.cs" />
-    <Compile Include="Helper\DllHelper.cs" />
-    <Compile Include="Message\AActorMessage.cs" />
-    <Compile Include="Message\AMessage.cs" />
-    <Compile Include="Message\AMActorHandler.cs" />
-    <Compile Include="Message\ErrorCode.cs" />
-    <Compile Include="Message\IMActorHandler.cs" />
-    <Compile Include="Message\OuterMessageDispatcher.cs" />
-    <Compile Include="Message\InnerMessageDispatcher.cs" />
-    <Compile Include="Message\IMHandler.cs" />
-    <Compile Include="Message\ActorMessageAttribute.cs" />
-    <Compile Include="Message\MessageAttribute.cs" />
-    <Compile Include="Message\ActorMessageHandlerAttribute.cs" />
-    <Compile Include="Message\MessageHandlerAttribute.cs" />
-    <Compile Include="Message\OpcodeHelper.cs" />
-    <Compile Include="Object\ComponentDB.cs" />
-    <Compile Include="Object\EntityType.cs" />
-    <Compile Include="Object\ObjectEvents.cs" />
+    <Compile Include="Base\Event\AEventAttribute.cs" />
+    <Compile Include="Base\Event\Env.cs" />
+    <Compile Include="Base\Event\EnvKey.cs" />
+    <Compile Include="Base\Event\EventAttribute.cs" />
+    <Compile Include="Base\Event\EventIdType.cs" />
+    <Compile Include="Base\Event\IEvent.cs" />
+    <Compile Include="Base\Helper\DllHelper.cs" />
+    <Compile Include="Base\Message\AActorMessage.cs" />
+    <Compile Include="Base\Message\AMessage.cs" />
+    <Compile Include="Base\Message\AMActorHandler.cs" />
+    <Compile Include="Base\Message\ErrorCode.cs" />
+    <Compile Include="Base\Message\IMActorHandler.cs" />
+    <Compile Include="Base\Message\OuterMessageDispatcher.cs" />
+    <Compile Include="Base\Message\InnerMessageDispatcher.cs" />
+    <Compile Include="Base\Message\IMHandler.cs" />
+    <Compile Include="Base\Message\ActorMessageAttribute.cs" />
+    <Compile Include="Base\Message\MessageAttribute.cs" />
+    <Compile Include="Base\Message\ActorMessageHandlerAttribute.cs" />
+    <Compile Include="Base\Message\MessageHandlerAttribute.cs" />
+    <Compile Include="Base\Message\OpcodeHelper.cs" />
+    <Compile Include="Base\Object\ComponentDB.cs" />
+    <Compile Include="Base\Object\EntityType.cs" />
+    <Compile Include="Base\Object\ObjectEvents.cs" />
     <Compile Include="Other\OneThreadSynchronizationContext.cs" />
     <Compile Include="Other\Options.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />

+ 9 - 0
Unity/Assets/Res/Config.meta

@@ -0,0 +1,9 @@
+fileFormatVersion: 2
+guid: 2e50214f335e0e94c90746b289a9ef48
+folderAsset: yes
+timeCreated: 1505113690
+licenseType: Free
+DefaultImporter:
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

BIN
Unity/Assets/Res/Config/BuffConfig.txt


+ 8 - 0
Unity/Assets/Res/Config/BuffConfig.txt.meta

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 0f3540faabf2b7e4c83e81cb7ba6a096
+timeCreated: 1505113794
+licenseType: Free
+TextScriptImporter:
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 56 - 0
Unity/Assets/Resources/Config.prefab

@@ -0,0 +1,56 @@
+%YAML 1.1
+%TAG !u! tag:unity3d.com,2011:
+--- !u!1 &184536
+GameObject:
+  m_ObjectHideFlags: 0
+  m_PrefabParentObject: {fileID: 0}
+  m_PrefabInternal: {fileID: 100100000}
+  serializedVersion: 5
+  m_Component:
+  - component: {fileID: 425028}
+  - component: {fileID: 114000012985339954}
+  m_Layer: 0
+  m_Name: Config
+  m_TagString: Untagged
+  m_Icon: {fileID: 0}
+  m_NavMeshLayer: 0
+  m_StaticEditorFlags: 0
+  m_IsActive: 1
+--- !u!4 &425028
+Transform:
+  m_ObjectHideFlags: 1
+  m_PrefabParentObject: {fileID: 0}
+  m_PrefabInternal: {fileID: 100100000}
+  m_GameObject: {fileID: 184536}
+  m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
+  m_LocalPosition: {x: 0, y: 0, z: 0}
+  m_LocalScale: {x: 1, y: 1, z: 1}
+  m_Children: []
+  m_Father: {fileID: 0}
+  m_RootOrder: 0
+  m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
+--- !u!1001 &100100000
+Prefab:
+  m_ObjectHideFlags: 1
+  serializedVersion: 2
+  m_Modification:
+    m_TransformParent: {fileID: 0}
+    m_Modifications: []
+    m_RemovedComponents: []
+  m_ParentPrefab: {fileID: 0}
+  m_RootGameObject: {fileID: 184536}
+  m_IsPrefabParent: 1
+--- !u!114 &114000012985339954
+MonoBehaviour:
+  m_ObjectHideFlags: 1
+  m_PrefabParentObject: {fileID: 0}
+  m_PrefabInternal: {fileID: 100100000}
+  m_GameObject: {fileID: 184536}
+  m_Enabled: 1
+  m_EditorHideFlags: 0
+  m_Script: {fileID: 11500000, guid: 502d8cafd6a5a0447ab1db9a24cdcb10, type: 3}
+  m_Name: 
+  m_EditorClassIdentifier: 
+  data:
+  - key: BuffConfig
+    gameObject: {fileID: 4900000, guid: 0f3540faabf2b7e4c83e81cb7ba6a096, type: 3}

+ 8 - 0
Unity/Assets/Resources/Config.prefab.meta

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 59151e2fab0f8f645bac00178f4344ac
+timeCreated: 1474946800
+licenseType: Pro
+NativeFormatImporter:
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 2 - 2
Unity/Assets/Scripts/Base/Object/Entity.cs

@@ -11,10 +11,10 @@ namespace Model
 	{
 		[BsonIgnore]
 		public Entity Parent { get; set; }
-		
+
 		[BsonElement]
 		[BsonIgnoreIfNull]
-		private HashSet<Component> components = new HashSet<Component>();
+		private HashSet<Component> components;
 
 		[BsonIgnore]
 		private Dictionary<Type, Component> componentDict = new Dictionary<Type, Component>();

+ 26 - 11
Server/Model/Component/ConfigComponent.cs → Unity/Assets/Scripts/Component/ConfigComponent.cs

@@ -1,28 +1,38 @@
 using System;
 using System.Collections.Generic;
-using System.Reflection;
 
 namespace Model
 {
 	[ObjectEvent]
-	public class ConfigComponentEvent : ObjectEvent<ConfigComponent>, ILoad
+	public class ConfigComponentEvent : ObjectEvent<ConfigComponent>, IAwake, ILoad
 	{
+		public void Awake()
+		{
+			this.Get().Awake();
+		}
+
 		public void Load()
 		{
 			this.Get().Load();
 		}
 	}
 
+	/// <summary>
+	/// Config组件会扫描所有的有ConfigAttribute标签的配置,加载进来
+	/// </summary>
 	public class ConfigComponent: Component
 	{
 		private Dictionary<Type, ICategory> allConfig;
 
-		public void Load()
+		public void Awake()
 		{
-			Assembly assembly = ObjectEvents.Instance.Get("Model");
+			this.Load();
+		}
 
+		public void Load()
+		{
 			this.allConfig = new Dictionary<Type, ICategory>();
-			Type[] types = assembly.GetTypes();
+			Type[] types = DllHelper.GetMonoTypes();
 
 			foreach (Type type in types)
 			{
@@ -48,7 +58,8 @@ namespace Model
 		public T GetOne<T>() where T : AConfig
 		{
 			Type type = typeof (T);
-			if (!this.allConfig.TryGetValue(type, out ICategory configCategory))
+			ICategory configCategory;
+			if (!this.allConfig.TryGetValue(type, out configCategory))
 			{
 				throw new Exception($"ConfigComponent not found key: {type.FullName}");
 			}
@@ -58,7 +69,8 @@ namespace Model
 		public T Get<T>(long id) where T : AConfig
 		{
 			Type type = typeof (T);
-			if (!this.allConfig.TryGetValue(type, out ICategory configCategory))
+			ICategory configCategory;
+			if (!this.allConfig.TryGetValue(type, out configCategory))
 			{
 				throw new Exception($"ConfigComponent not found key: {type.FullName}");
 			}
@@ -68,7 +80,8 @@ namespace Model
 		public T TryGet<T>(int id) where T : AConfig
 		{
 			Type type = typeof (T);
-			if (!this.allConfig.TryGetValue(type, out ICategory configCategory))
+			ICategory configCategory;
+			if (!this.allConfig.TryGetValue(type, out configCategory))
 			{
 				return default(T);
 			}
@@ -78,7 +91,8 @@ namespace Model
 		public T[] GetAll<T>() where T : AConfig
 		{
 			Type type = typeof (T);
-			if (!this.allConfig.TryGetValue(type, out ICategory configCategory))
+			ICategory configCategory;
+			if (!this.allConfig.TryGetValue(type, out configCategory))
 			{
 				throw new Exception($"ConfigComponent not found key: {type.FullName}");
 			}
@@ -89,8 +103,9 @@ namespace Model
 		{
 			T t = new T();
 			Type type = t.ConfigType;
-			bool ret = this.allConfig.TryGetValue(type, out ICategory category);
-			return ret? (T) category : null;
+			ICategory configCategory;
+			bool ret = this.allConfig.TryGetValue(type, out configCategory);
+			return ret? (T)configCategory : null;
 		}
 	}
 }

+ 3 - 0
Unity/Assets/Scripts/Component/ConfigComponent.cs.meta

@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: c38338e46c7049bdbfaf34a0ab31cb52
+timeCreated: 1505111255

+ 9 - 0
Unity/Assets/Scripts/Init.cs

@@ -6,6 +6,7 @@ using System.Threading;
 using ILRuntime.CLR.Method;
 using ILRuntime.CLR.TypeSystem;
 using ILRuntime.Runtime.Enviorment;
+using MongoDB.Bson.IO;
 using UnityEngine;
 
 namespace Model
@@ -57,6 +58,14 @@ namespace Model
 				this.lateUpdate = new MonoStaticMethod(hotfixInit, "LateUpdate");
 				this.onApplicationQuit = new MonoStaticMethod(hotfixInit, "OnApplicationQuit");
 #endif
+
+				Game.Scene.AddComponent<OpcodeTypeComponent>();
+				Game.Scene.AddComponent<MessageDispatherComponent>();
+				Game.Scene.AddComponent<NetOuterComponent>();
+				Game.Scene.AddComponent<ResourcesComponent>();
+				Game.Scene.AddComponent<BehaviorTreeComponent>();
+				Game.Scene.AddComponent<ConfigComponent>();
+
 				// 进入热更新层
 				this.start.Run();
 			}

+ 0 - 0
Unity/Assets/Scripts/Config.meta → Unity/Assets/Scripts/MonoConfig.meta


+ 0 - 0
Unity/Assets/Scripts/Config/CanvasConfig.cs → Unity/Assets/Scripts/MonoConfig/CanvasConfig.cs


+ 0 - 0
Unity/Assets/Scripts/Config/CanvasConfig.cs.meta → Unity/Assets/Scripts/MonoConfig/CanvasConfig.cs.meta


+ 0 - 5
Unity/Hotfix/Init.cs

@@ -10,11 +10,6 @@ namespace Hotfix
 			try
 			{
 				Hotfix.Scene.ModelScene = Game.Scene;
-				Hotfix.Scene.ModelScene.AddComponent<OpcodeTypeComponent>();
-				Hotfix.Scene.ModelScene.AddComponent<Model.MessageDispatherComponent>();
-				Hotfix.Scene.ModelScene.AddComponent<NetOuterComponent>();
-				Hotfix.Scene.ModelScene.AddComponent<ResourcesComponent>();
-				Hotfix.Scene.ModelScene.AddComponent<BehaviorTreeComponent>();
 				Hotfix.Scene.AddComponent<UIComponent>();
 				Hotfix.Scene.GetComponent<EventComponent>().Run(EventIdType.InitSceneStart);
 			}

+ 1 - 0
Unity/Unity.Editor.csproj

@@ -180,6 +180,7 @@
     <None Include="Assets\JsonDotNet\Assemblies\Standalone\Newtonsoft.Json.XML" />
     <None Include="Assets\JsonDotNet\Assemblies\Windows\Newtonsoft.Json.XML" />
     <None Include="Assets\JsonDotNet\link.xml" />
+    <None Include="Assets\Res\Config\BuffConfig.txt" />
   </ItemGroup>
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
   <Target Name="GenerateTargetFrameworkMonikerAttribute" />

+ 1 - 0
Unity/Unity.Plugins.csproj

@@ -501,6 +501,7 @@
     <None Include="Assets\JsonDotNet\Assemblies\Standalone\Newtonsoft.Json.XML" />
     <None Include="Assets\JsonDotNet\Assemblies\Windows\Newtonsoft.Json.XML" />
     <None Include="Assets\JsonDotNet\link.xml" />
+    <None Include="Assets\Res\Config\BuffConfig.txt" />
   </ItemGroup>
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
   <Target Name="GenerateTargetFrameworkMonikerAttribute" />

+ 3 - 1
Unity/Unity.csproj

@@ -496,6 +496,7 @@
     <Compile Include="Assets\Scripts\Component\Config\RunServerConfig.cs" />
     <Compile Include="Assets\Scripts\Component\Config\StartConfig.cs" />
     <Compile Include="Assets\Scripts\Component\Config\VersionConfig.cs" />
+    <Compile Include="Assets\Scripts\Component\ConfigComponent.cs" />
     <Compile Include="Assets\Scripts\Component\CrossComponent.cs" />
     <Compile Include="Assets\Scripts\Component\EventComponent.cs" />
     <Compile Include="Assets\Scripts\Component\MessageDispatherComponent.cs" />
@@ -504,7 +505,6 @@
     <Compile Include="Assets\Scripts\Component\OpcodeTypeComponent.cs" />
     <Compile Include="Assets\Scripts\Component\ResourcesComponent.cs" />
     <Compile Include="Assets\Scripts\Component\TimerComponent.cs" />
-    <Compile Include="Assets\Scripts\Config\CanvasConfig.cs" />
     <Compile Include="Assets\Scripts\Entity\AssetBundleLoaderAsync.cs" />
     <Compile Include="Assets\Scripts\Entity\Game.cs" />
     <Compile Include="Assets\Scripts\Entity\Message\InnerMessage.cs" />
@@ -522,6 +522,7 @@
     <Compile Include="Assets\Scripts\Helper\MongoHelper.cs" />
     <Compile Include="Assets\Scripts\Helper\ResourceHelper.cs" />
     <Compile Include="Assets\Scripts\Init.cs" />
+    <Compile Include="Assets\Scripts\MonoConfig\CanvasConfig.cs" />
     <Compile Include="Assets\Scripts\Other\Define.cs" />
     <Compile Include="Assets\Scripts\Other\IInstanceMethod.cs" />
     <Compile Include="Assets\Scripts\Other\ILMethod.cs" />
@@ -533,6 +534,7 @@
     <None Include="Assets\JsonDotNet\Assemblies\Standalone\Newtonsoft.Json.XML" />
     <None Include="Assets\JsonDotNet\Assemblies\Windows\Newtonsoft.Json.XML" />
     <None Include="Assets\JsonDotNet\link.xml" />
+    <None Include="Assets\Res\Config\BuffConfig.txt" />
   </ItemGroup>
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
   <Target Name="GenerateTargetFrameworkMonikerAttribute" />