فهرست منبع

1.自动注册ILRuntime Adaptor,加上ILAdaptorAttribute即可
2.行为树节点移动到Model里面,行为树节点代码以后不支持热更新,但是行为树配置可以热更新
3.删除了Controller,由Hotfix工程替代

tanghai 9 سال پیش
والد
کامیت
1c1482b695
33فایلهای تغییر یافته به همراه1223 افزوده شده و 743 حذف شده
  1. 1 1
      Config/StartConfig/ClientConfig.txt
  2. 0 2
      Unity/Assets/Editor/BehaviorTreeEditor/BehaviorManager.cs
  3. 0 2
      Unity/Assets/Editor/BehaviorTreeEditor/BehaviorTreeOperateUtility.cs
  4. 1 2
      Unity/Assets/Editor/BehaviorTreeEditor/Event/BehaviorTreeRightDesignerDragEvent_ModifyRightBorder.cs
  5. 2 2
      Unity/Assets/Editor/BehaviorTreeEditor/ExportNodeTypeConfig.cs
  6. 2 2
      Unity/Assets/Editor/BehaviorTreeEditor/NodeExtension.cs
  7. 9 0
      Unity/Assets/Scripts/BehaviorTreeNode.meta
  8. 1 3
      Unity/Assets/Scripts/BehaviorTreeNode/Root.cs
  9. 12 0
      Unity/Assets/Scripts/BehaviorTreeNode/Root.cs.meta
  10. 1 5
      Unity/Assets/Scripts/BehaviorTreeNode/Selector.cs
  11. 12 0
      Unity/Assets/Scripts/BehaviorTreeNode/Selector.cs.meta
  12. 1 3
      Unity/Assets/Scripts/BehaviorTreeNode/Sequence.cs
  13. 12 0
      Unity/Assets/Scripts/BehaviorTreeNode/Sequence.cs.meta
  14. 1 5
      Unity/Assets/Scripts/BehaviorTreeNode/True.cs
  15. 12 0
      Unity/Assets/Scripts/BehaviorTreeNode/True.cs.meta
  16. 18 0
      Unity/Assets/Scripts/Component/BenchmarkComponent.cs
  17. 66 0
      Unity/Assets/Scripts/Component/ILRuntimeComponent.cs
  18. 12 0
      Unity/Assets/Scripts/Component/ILRuntimeComponent.cs.meta
  19. 1 0
      Unity/Assets/Scripts/ILAdaptor/IAsyncStateMachineAdaptor.cs
  20. 1 30
      Unity/Assets/Scripts/Init.cs
  21. 9 0
      Unity/Assets/Scripts/Other/ILAdapterAttribute.cs
  22. 12 0
      Unity/Assets/Scripts/Other/ILAdapterAttribute.cs.meta
  23. 1016 474
      Unity/CSharp60Support/compilation.log
  24. 0 28
      Unity/Controller/Component/BenchmarkComponentE.cs
  25. 0 14
      Unity/Controller/Message/R2C_ServerLogHandler.cs
  26. 0 36
      Unity/Controller/Properties/AssemblyInfo.cs
  27. 0 93
      Unity/Controller/Unity.Controller.csproj
  28. 9 8
      Unity/Hotfix/HotfixEntry.cs
  29. 0 26
      Unity/Hotfix/Init.cs
  30. 0 0
      Unity/Hotfix/UI/UILogin/Factory/UILoginFactory.cs
  31. 6 1
      Unity/Hotfix/Unity.Hotfix.csproj
  32. 6 0
      Unity/Unity.csproj
  33. 0 6
      Unity/Unity.sln

+ 1 - 1
Config/StartConfig/ClientConfig.txt

@@ -1 +1 @@
-{ "_t" : "StartConfig", "_id" : NumberLong("96935508377601"), "Type" : 4, "components" : [{ "_t" : "ClientConfig", "_id" : NumberLong("96935508377602"), "Host" : "192.168.9.182", "Port" : 10000 }], "AppId" : 0, "AppType" : "Client", "ServerIP" : "*" }
+{ "_t" : "StartConfig", "_id" : NumberLong("96935508377601"), "Type" : 4, "components" : [{ "_t" : "ClientConfig", "_id" : NumberLong("96935508377602"), "Host" : "127.0.0.1", "Port" : 10000 }], "AppId" : 0, "AppType" : "Client", "ServerIP" : "*" }

+ 0 - 2
Unity/Assets/Editor/BehaviorTreeEditor/BehaviorManager.cs

@@ -102,8 +102,6 @@ namespace MyEditor
 
 		public void NewLoadData()
 		{
-			Game.EntityEventManager.Register("Controller", DllHelper.GetController());
-
 			LoadNodeTypeProto();
 			NewLoadPrefabTree();
 			FilterClassify();

+ 0 - 2
Unity/Assets/Editor/BehaviorTreeEditor/BehaviorTreeOperateUtility.cs

@@ -101,8 +101,6 @@ namespace MyEditor
 			GameObject prefab = null;
 			try
 			{
-				Game.EntityEventManager.Register("Controller", DllHelper.GetController());
-
 				GameObject go = new GameObject();
 				BehaviorTreeConfig newConfig = go.AddComponent<BehaviorTreeConfig>();
 				BehaviorNodeConfig root = newConfig.AddRootNode(rootNodeName);

+ 1 - 2
Unity/Assets/Editor/BehaviorTreeEditor/Event/BehaviorTreeRightDesignerDragEvent_ModifyRightBorder.cs

@@ -1,7 +1,6 @@
 using Model;
-using MyEditor;
 
-namespace Controller
+namespace MyEditor
 {
 	[Event(EventIdType.BehaviorTreeRightDesignerDrag)]
 	public class BehaviorTreeRightDesignerDragEvent_ModifyRightBorder: IEvent<float>

+ 2 - 2
Unity/Assets/Editor/BehaviorTreeEditor/ExportNodeTypeConfig.cs

@@ -46,7 +46,7 @@ namespace MyEditor
 
 		public static Assembly GetControllerAssembly()
 		{
-			return Game.EntityEventManager.GetAssembly("Controller");
+			return Game.EntityEventManager.GetAssembly("Model");
 		}
 
 		public static ClientNodeTypeProto GetNodeTypeProtoFromDll(string name)
@@ -268,7 +268,7 @@ namespace MyEditor
 		public static Type GetNodeType(string nodeName)
 		{
 			Assembly assembly = GetControllerAssembly();
-			Type nodeType = assembly.GetType("Controller." + nodeName);
+			Type nodeType = assembly.GetType("Model." + nodeName);
 			if (nodeType == null)
 			{
 				Log.Error($"不存在此节点:{nodeName}");

+ 2 - 2
Unity/Assets/Editor/BehaviorTreeEditor/NodeExtension.cs

@@ -14,7 +14,7 @@ namespace Model
 
 		public BTEditorTree(BehaviorTreeConfig config)
 		{
-			Type rootType = Game.EntityEventManager.GetAssembly("Controller").GetType($"Controller.{config.RootNodeProto.name}");
+			Type rootType = Game.EntityEventManager.GetAssembly("Model").GetType($"Model.{config.RootNodeProto.name}");
 			Node root = (Node) Activator.CreateInstance(rootType, config.RootNodeProto);
 			root.Id = BehaviorManager.NodeIdStartIndex;
 			Queue<NodeProto> protoStack = new Queue<NodeProto>();
@@ -33,7 +33,7 @@ namespace Model
 				}
 				foreach (NodeProto child in p.Children)
 				{
-					Type t = Game.EntityEventManager.GetAssembly("Controller").GetType($"Controller.{child.name}");
+					Type t = Game.EntityEventManager.GetAssembly("Model").GetType($"Model.{child.name}");
 					Node childNode = (Node) Activator.CreateInstance(t, child);
 					AddChild(childNode, node);
 					protoStack.Enqueue(child);

+ 9 - 0
Unity/Assets/Scripts/BehaviorTreeNode.meta

@@ -0,0 +1,9 @@
+fileFormatVersion: 2
+guid: 4d42efc3fe0e75c439de9b213824243a
+folderAsset: yes
+timeCreated: 1486634839
+licenseType: Pro
+DefaultImporter:
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 1 - 3
Unity/Controller/BehaviorTree/Root.cs → Unity/Assets/Scripts/BehaviorTreeNode/Root.cs

@@ -1,6 +1,4 @@
-using Model;
-
-namespace Controller
+namespace Model
 {
 	[Node(NodeClassifyType.Root, "创建时的默认root节点,必须修改为正确的root节点")]
 	public class Root: Node

+ 12 - 0
Unity/Assets/Scripts/BehaviorTreeNode/Root.cs.meta

@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: e9ad64c01fb092042aeec64e2b4a58c1
+timeCreated: 1486634840
+licenseType: Pro
+MonoImporter:
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 1 - 5
Unity/Controller/BehaviorTree/Selector.cs → Unity/Assets/Scripts/BehaviorTreeNode/Selector.cs

@@ -1,6 +1,4 @@
-using Model;
-
-namespace Controller
+namespace Model
 {
 	[Node(NodeClassifyType.Composite)]
 	public class Selector: Node
@@ -11,8 +9,6 @@ namespace Controller
 
 		protected override bool Run(BehaviorTree behaviorTree, BTEnv env)
 		{
-			
-
 			foreach (Node child in this.children)
 			{
 				if (child.DoRun(behaviorTree, env))

+ 12 - 0
Unity/Assets/Scripts/BehaviorTreeNode/Selector.cs.meta

@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: e6fab96dc6fdfe04dae721a1283aec9c
+timeCreated: 1486634840
+licenseType: Pro
+MonoImporter:
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 1 - 3
Unity/Controller/BehaviorTree/Sequence.cs → Unity/Assets/Scripts/BehaviorTreeNode/Sequence.cs

@@ -1,6 +1,4 @@
-using Model;
-
-namespace Controller
+namespace Model
 {
 	[Node(NodeClassifyType.Composite)]
 	internal class Sequence: Node

+ 12 - 0
Unity/Assets/Scripts/BehaviorTreeNode/Sequence.cs.meta

@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: 2a6a9bd792c7a87469498f1a480085e4
+timeCreated: 1486634840
+licenseType: Pro
+MonoImporter:
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 1 - 5
Unity/Controller/BehaviorTree/True.cs → Unity/Assets/Scripts/BehaviorTreeNode/True.cs

@@ -1,6 +1,4 @@
-using Model;
-
-namespace Controller
+namespace Model
 {
 	[Node(NodeClassifyType.Decorator)]
 	public class True: Node
@@ -11,8 +9,6 @@ namespace Controller
 
 		protected override bool Run(BehaviorTree behaviorTree, BTEnv env)
 		{
-			
-
 			foreach (Node child in children)
 			{
 				child.DoRun(behaviorTree, env);

+ 12 - 0
Unity/Assets/Scripts/BehaviorTreeNode/True.cs.meta

@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: b9c6a7d0186214c4f820528de53f4acb
+timeCreated: 1486634840
+licenseType: Pro
+MonoImporter:
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 18 - 0
Unity/Assets/Scripts/Component/BenchmarkComponent.cs

@@ -9,6 +9,24 @@ namespace Model
 
 		private long time1 = TimeHelper.ClientNow();
 
+		private async void Awake(string address)
+		{
+			try
+			{
+				NetOuterComponent networkComponent = Game.Scene.GetComponent<NetOuterComponent>();
+
+				for (int i = 0; i < 100; i++)
+				{
+					await Game.Scene.GetComponent<TimerComponent>().WaitAsync(10);
+					this.TestAsync(networkComponent, address, i);
+				}
+			}
+			catch (Exception e)
+			{
+				Log.Error(e.ToString());
+			}
+		}
+
 		public async void TestAsync(NetOuterComponent networkComponent, string address, int j)
 		{
 			try

+ 66 - 0
Unity/Assets/Scripts/Component/ILRuntimeComponent.cs

@@ -0,0 +1,66 @@
+using System;
+using System.IO;
+using System.Reflection;
+using ILRuntime.CLR.Method;
+using ILRuntime.Runtime.Enviorment;
+using UnityEngine;
+
+namespace Model
+{
+	[EntityEvent(typeof(ILRuntimeComponent))]
+	public class ILRuntimeComponent : Component
+	{
+		private ILRuntime.Runtime.Enviorment.AppDomain appDomain;
+
+		private readonly object[] param0 = new object[0];
+
+		private IMethod start;
+
+		private void Awake()
+		{
+			appDomain = new ILRuntime.Runtime.Enviorment.AppDomain();
+
+			GameObject code = (GameObject)Resources.Load("Code");
+			byte[] assBytes = code.Get<TextAsset>("Hotfix.dll").bytes;
+			byte[] mdbBytes = code.Get<TextAsset>("Hotfix.pdb").bytes;
+
+			using (MemoryStream fs = new MemoryStream(assBytes))
+			using (MemoryStream p = new MemoryStream(mdbBytes))
+			{
+				appDomain.LoadAssembly(fs, p, new Mono.Cecil.Pdb.PdbReaderProvider());
+			}
+
+			Assembly assembly = Game.EntityEventManager.GetAssembly("Model");
+
+			foreach (Type type in assembly.GetTypes())
+			{
+				object[] attrs = type.GetCustomAttributes(typeof(ILAdapterAttribute), false);
+				if (attrs.Length == 0)
+				{
+					continue;
+				}
+				object obj = Activator.CreateInstance(type);
+				CrossBindingAdaptor adaptor = obj as CrossBindingAdaptor;
+				if (adaptor == null)
+				{
+					continue;
+				}
+				appDomain.RegisterCrossBindingAdaptor(adaptor);
+			}
+			
+			this.start = appDomain.LoadedTypes["Hotfix.HotfixEntry"].GetMethod("Start", 0);
+			
+			appDomain.Invoke(this.start, null, param0);
+		}
+
+		public override void Dispose()
+		{
+			if (this.Id == 0)
+			{
+				return;
+			}
+
+			base.Dispose();
+		}
+	}
+}

+ 12 - 0
Unity/Assets/Scripts/Component/ILRuntimeComponent.cs.meta

@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: d83d443700c93f549aaa52af4da20fa8
+timeCreated: 1486633782
+licenseType: Pro
+MonoImporter:
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 1 - 0
Unity/Assets/Scripts/ILAdaptor/IAsyncStateMachineAdaptor.cs

@@ -9,6 +9,7 @@ namespace Model
 	/// <summary>
 	/// 用于async await适配
 	/// </summary>
+	[ILAdapter]
 	public class IAsyncStateMachineClassInheritanceAdaptor : CrossBindingAdaptor
 	{
 		public override Type BaseCLRType

+ 1 - 30
Unity/Assets/Scripts/Init.cs

@@ -1,51 +1,22 @@
 using System;
 using System.IO;
 using Base;
-using ILRuntime.CLR.Method;
 using UnityEngine;
 
 namespace Model
 {
 	public class Init: MonoBehaviour
 	{
-		private ILRuntime.Runtime.Enviorment.AppDomain appDomain;
-
-		private readonly object[] param0 = new object[0];
-
-		private IMethod start;
-
-		private IMethod update;
-
 		private void Start()
 		{
-			appDomain = new ILRuntime.Runtime.Enviorment.AppDomain();
-
 			Game.EntityEventManager.Register("Model", typeof (Game).Assembly);
-
-			GameObject code = (GameObject)Resources.Load("Code");
-			byte[] assBytes = code.Get<TextAsset>("Hotfix.dll").bytes;
-			byte[] mdbBytes = code.Get<TextAsset>("Hotfix.pdb").bytes;
-
-			using (MemoryStream fs = new MemoryStream(assBytes))
-			using (MemoryStream p = new MemoryStream(mdbBytes))
-			{
-				appDomain.LoadAssembly(fs, p, new Mono.Cecil.Pdb.PdbReaderProvider());
-			}
-
-			appDomain.RegisterCrossBindingAdaptor(new IAsyncStateMachineClassInheritanceAdaptor());
-
-			this.start = appDomain.LoadedTypes["Hotfix.Init"].GetMethod("Start", 0);
-			this.update = appDomain.LoadedTypes["Hotfix.Init"].GetMethod("Update", 0);
-
-
-			appDomain.Invoke(this.start, null, param0);
+			Game.Scene.AddComponent<ILRuntimeComponent>();
 		}
 
 		private void Update()
 		{
 			try
 			{
-				appDomain.Invoke(this.update, null, param0);
 				Game.EntityEventManager.Update();
 			}
 			catch (Exception e)

+ 9 - 0
Unity/Assets/Scripts/Other/ILAdapterAttribute.cs

@@ -0,0 +1,9 @@
+using System;
+
+namespace Model
+{
+	[AttributeUsage(AttributeTargets.Class)]
+	public class ILAdapterAttribute : Attribute
+	{
+	}
+}

+ 12 - 0
Unity/Assets/Scripts/Other/ILAdapterAttribute.cs.meta

@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: 4bcd750c3779547449f9cb1a567f7ee1
+timeCreated: 1486638218
+licenseType: Pro
+MonoImporter:
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 1016 - 474
Unity/CSharp60Support/compilation.log


+ 0 - 28
Unity/Controller/Component/BenchmarkComponentE.cs

@@ -1,28 +0,0 @@
-using System;
-using Base;
-using Model;
-
-namespace Controller
-{
-	[EntityEvent(typeof(BenchmarkComponent))]
-	public static class BenchmakComponentE
-	{
-		private static async void Awake(this BenchmarkComponent component, string address)
-		{
-			try
-			{
-				NetOuterComponent networkComponent = Game.Scene.GetComponent<NetOuterComponent>();
-
-				for (int i = 0; i < 100; i++)
-				{
-					await Game.Scene.GetComponent<TimerComponent>().WaitAsync(10);
-					component.TestAsync(networkComponent, address, i);
-				}
-			}
-			catch (Exception e)
-			{
-				Log.Error(e.ToString());
-			}
-		}
-	}
-}

+ 0 - 14
Unity/Controller/Message/R2C_ServerLogHandler.cs

@@ -1,14 +0,0 @@
-using Base;
-using Model;
-
-namespace Controller
-{
-	[MessageHandler(AppType.Client)]
-	public class R2C_ServerLogHandler: AMHandler<R2C_ServerLog>
-	{
-		protected override void Run(Session scene, R2C_ServerLog message)
-		{
-			Log.Debug($"[{message.AppType}][{message.AppId}] [{message.Type}] {message.Log}");
-		}
-	}
-}

+ 0 - 36
Unity/Controller/Properties/AssemblyInfo.cs

@@ -1,36 +0,0 @@
-using System.Reflection;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-
-// 有关程序集的常规信息通过以下
-// 特性集控制。更改这些特性值可修改
-// 与程序集关联的信息。
-[assembly: AssemblyTitle("HotfixCode")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("Microsoft")]
-[assembly: AssemblyProduct("HotfixCode")]
-[assembly: AssemblyCopyright("Copyright © Microsoft 2015")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// 将 ComVisible 设置为 false 使此程序集中的类型
-// 对 COM 组件不可见。  如果需要从 COM 访问此程序集中的类型,
-// 则将该类型上的 ComVisible 特性设置为 true。
-[assembly: ComVisible(false)]
-
-// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
-[assembly: Guid("c7e6915a-d61a-47f4-b694-d0a1e95a23e8")]
-
-// 程序集的版本信息由下面四个值组成: 
-//
-//      主版本
-//      次版本 
-//      生成号
-//      修订号
-//
-// 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值,
-// 方法是按如下所示使用“*”: 
-// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.0.0.*")]
-[assembly: AssemblyFileVersion("1.0.0.0")]

+ 0 - 93
Unity/Controller/Unity.Controller.csproj

@@ -1,93 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
-  <PropertyGroup>
-    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
-    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
-    <ProjectGuid>{E875513C-291C-4378-815E-85D7DFB8C1A9}</ProjectGuid>
-    <OutputType>Library</OutputType>
-    <AppDesignerFolder>Properties</AppDesignerFolder>
-    <RootNamespace>Controller</RootNamespace>
-    <AssemblyName>Controller</AssemblyName>
-    <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
-    <FileAlignment>512</FileAlignment>
-    <TargetFrameworkProfile>Unity Full v3.5</TargetFrameworkProfile>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
-    <DebugSymbols>true</DebugSymbols>
-    <DebugType>full</DebugType>
-    <Optimize>false</Optimize>
-    <OutputPath>..\Temp\UnityVS_bin\Debug\</OutputPath>
-    <DefineConstants>DEBUG;TRACE</DefineConstants>
-    <ErrorReport>prompt</ErrorReport>
-    <WarningLevel>4</WarningLevel>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
-    <DebugType>pdbonly</DebugType>
-    <Optimize>true</Optimize>
-    <OutputPath>bin\Release\</OutputPath>
-    <DefineConstants>TRACE</DefineConstants>
-    <ErrorReport>prompt</ErrorReport>
-    <WarningLevel>4</WarningLevel>
-  </PropertyGroup>
-  <PropertyGroup>
-    <RunPostBuildEvent>OnOutputUpdated</RunPostBuildEvent>
-  </PropertyGroup>
-  <ItemGroup>
-    <Reference Include="AsyncBridge.Net35, Version=0.0.0.0, Culture=neutral, PublicKeyToken=b3b1c0202c0d6a87, processorArchitecture=MSIL">
-      <SpecificVersion>False</SpecificVersion>
-      <HintPath>..\Assets\CSharp vNext Support\AsyncTools\Plugins\AsyncBridge.Net35.dll</HintPath>
-    </Reference>
-    <Reference Include="System" />
-    <Reference Include="System.Core" />
-    <Reference Include="System.Threading, Version=1.0.2856.102, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
-      <SpecificVersion>False</SpecificVersion>
-      <HintPath>..\Assets\CSharp vNext Support\AsyncTools\Plugins\System.Threading.dll</HintPath>
-    </Reference>
-    <Reference Include="System.Xml.Linq" />
-    <Reference Include="System.Data" />
-    <Reference Include="System.Xml" />
-    <Reference Include="UnityEngine, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
-      <SpecificVersion>False</SpecificVersion>
-      <HintPath>..\Library\UnityAssemblies\UnityEngine.dll</HintPath>
-    </Reference>
-  </ItemGroup>
-  <ItemGroup>
-    <Compile Include="BehaviorTree\Root.cs" />
-    <Compile Include="BehaviorTree\Selector.cs" />
-    <Compile Include="BehaviorTree\Sequence.cs" />
-    <Compile Include="BehaviorTree\True.cs" />
-    <Compile Include="Component\BenchmarkComponentE.cs" />
-    <Compile Include="Event\InitSceneStartEvent_InitGame.cs" />
-    <Compile Include="Message\R2C_ServerLogHandler.cs" />
-    <Compile Include="Properties\AssemblyInfo.cs" />
-    <Compile Include="UI\UILogin\Factory\UILoginFactory.cs" />
-  </ItemGroup>
-  <ItemGroup>
-    <ProjectReference Include="..\Unity.csproj">
-      <Project>{cf118143-7e37-744f-be45-3f55345fec40}</Project>
-      <Name>Unity</Name>
-    </ProjectReference>
-    <ProjectReference Include="..\Unity.Plugins.csproj">
-      <Project>{d1fdb199-0fb7-099d-3771-c6a942e4e326}</Project>
-      <Name>Unity.Plugins</Name>
-    </ProjectReference>
-  </ItemGroup>
-  <ItemGroup>
-    <Folder Include="Factory\" />
-    <Folder Include="Handler\" />
-    <Folder Include="Helper\" />
-    <Folder Include="Logic\" />
-  </ItemGroup>
-  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
-  <PropertyGroup>
-    <PostBuildEvent>echo A | xcopy $(TargetName).pdb $(SolutionDir)Assets\Res\Code\$(TargetFileName).mdb.bytes</PostBuildEvent>
-  </PropertyGroup>
-  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
-       Other similar extension points exist, see Microsoft.Common.targets.
-  <Target Name="BeforeBuild">
-  </Target>
-  <Target Name="AfterBuild">
-  </Target>
-  -->
-</Project>

+ 9 - 8
Unity/Controller/Event/InitSceneStartEvent_InitGame.cs → Unity/Hotfix/HotfixEntry.cs

@@ -2,15 +2,16 @@
 using Base;
 using Model;
 
-namespace Controller
+namespace Hotfix
 {
-	/// <summary>
-	/// 初始化游戏
-	/// </summary>
-	[Event(EventIdType.InitSceneStart)]
-	public class InitSceneStartEvent_InitGame: IEvent
+	public static class HotfixEntry
 	{
-		public async void Run()
+		public static void Start()
+		{
+			Login();
+		}
+
+		public static async void Login()
 		{
 			try
 			{
@@ -27,7 +28,7 @@ namespace Controller
 					{
 						await gateSession.Call<C2G_LoginGate, G2C_LoginGate>(new C2G_LoginGate(s2CLogin.Key));
 					}
-					
+
 					Log.Info("连接Gate验证成功!");
 				}
 			}

+ 0 - 26
Unity/Hotfix/Init.cs

@@ -1,26 +0,0 @@
-using Base;
-using Model;
-
-namespace Hotfix
-{
-	public class Init
-	{
-		public void Start()
-		{
-			StartAsync();
-		}
-
-		public async void StartAsync()
-		{
-			while (true)
-			{
-				await Game.Scene.GetComponent<TimerComponent>().WaitAsync(1000);
-				Log.Debug("11111111111111111111111111111111111111");
-			}
-		}
-
-		public void Update()
-		{
-		}
-	}
-}

+ 0 - 0
Unity/Controller/UI/UILogin/Factory/UILoginFactory.cs → Unity/Hotfix/UI/UILogin/Factory/UILoginFactory.cs


+ 6 - 1
Unity/Hotfix/Unity.Hotfix.csproj

@@ -45,10 +45,15 @@
     <Reference Include="System.Data.DataSetExtensions" />
     <Reference Include="System.Data" />
     <Reference Include="System.Xml" />
+    <Reference Include="UnityEngine, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\Library\UnityAssemblies\UnityEngine.dll</HintPath>
+    </Reference>
   </ItemGroup>
   <ItemGroup>
-    <Compile Include="Init.cs" />
+    <Compile Include="HotfixEntry.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
+    <Compile Include="UI\UILogin\Factory\UILoginFactory.cs" />
   </ItemGroup>
   <ItemGroup>
     <ProjectReference Include="..\Unity.csproj">

+ 6 - 0
Unity/Unity.csproj

@@ -322,6 +322,10 @@
     <Compile Include="Assets\ILRuntime\Mono.Cecil.Pdb\pdb\Mono.Cecil.Pdb\PdbWriter.cs" />
     <Compile Include="Assets\ILRuntime\Mono.Cecil.Pdb\pdb\Mono.Cecil.Pdb\SymDocumentWriter.cs" />
     <Compile Include="Assets\ILRuntime\Mono.Cecil.Pdb\pdb\Mono.Cecil.Pdb\SymWriter.cs" />
+    <Compile Include="Assets\Scripts\BehaviorTreeNode\Root.cs" />
+    <Compile Include="Assets\Scripts\BehaviorTreeNode\Selector.cs" />
+    <Compile Include="Assets\Scripts\BehaviorTreeNode\Sequence.cs" />
+    <Compile Include="Assets\Scripts\BehaviorTreeNode\True.cs" />
     <Compile Include="Assets\Scripts\BehaviorTree\BTEnv.cs" />
     <Compile Include="Assets\Scripts\BehaviorTree\BTEnvKey.cs" />
     <Compile Include="Assets\Scripts\BehaviorTree\BehaviorNodeConfig.cs" />
@@ -372,6 +376,7 @@
     <Compile Include="Assets\Scripts\BehaviorTree\NodePropAttribute.cs" />
     <Compile Include="Assets\Scripts\BehaviorTree\NodeProto.cs" />
     <Compile Include="Assets\Scripts\BehaviorTree\ValueBase.cs" />
+    <Compile Include="Assets\Scripts\Component\ILRuntimeComponent.cs" />
     <Compile Include="Assets\Scripts\Component\BenchmarkComponent.cs" />
     <Compile Include="Assets\Scripts\Component\ChildrenComponent.cs" />
     <Compile Include="Assets\Scripts\Component\ClientConfigComponent.cs" />
@@ -440,6 +445,7 @@
     <Compile Include="Assets\Scripts\Other\IUIFactory.cs" />
     <Compile Include="Assets\Scripts\Other\LayerNames.cs" />
     <Compile Include="Assets\Scripts\Other\Options.cs" />
+    <Compile Include="Assets\Scripts\Other\ILAdapterAttribute.cs" />
     <Compile Include="Assets\Scripts\Other\UIFactoryAttribute.cs" />
     <Compile Include="Assets\Scripts\Other\UIType.cs" />
     <Compile Include="Assets\Scripts\ReferenceCollector.cs" />

+ 0 - 6
Unity/Unity.sln

@@ -9,8 +9,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Unity", "Unity.csproj", "{C
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Unity.Editor", "Unity.Editor.csproj", "{C17F48D3-964E-E97C-3D2E-966F7A6C6D93}"
 EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Unity.Controller", "Controller\Unity.Controller.csproj", "{E875513C-291C-4378-815E-85D7DFB8C1A9}"
-EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Unity.Hotfix", "Hotfix\Unity.Hotfix.csproj", "{40533600-4E69-4F7D-A924-E1A3B4127255}"
 EndProject
 Global
@@ -31,10 +29,6 @@ Global
 		{C17F48D3-964E-E97C-3D2E-966F7A6C6D93}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{C17F48D3-964E-E97C-3D2E-966F7A6C6D93}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{C17F48D3-964E-E97C-3D2E-966F7A6C6D93}.Release|Any CPU.Build.0 = Release|Any CPU
-		{E875513C-291C-4378-815E-85D7DFB8C1A9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-		{E875513C-291C-4378-815E-85D7DFB8C1A9}.Debug|Any CPU.Build.0 = Debug|Any CPU
-		{E875513C-291C-4378-815E-85D7DFB8C1A9}.Release|Any CPU.ActiveCfg = Release|Any CPU
-		{E875513C-291C-4378-815E-85D7DFB8C1A9}.Release|Any CPU.Build.0 = Release|Any CPU
 		{40533600-4E69-4F7D-A924-E1A3B4127255}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{40533600-4E69-4F7D-A924-E1A3B4127255}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{40533600-4E69-4F7D-A924-E1A3B4127255}.Release|Any CPU.ActiveCfg = Release|Any CPU

برخی فایل ها در این مقایسه diff نمایش داده نمی شوند زیرا تعداد فایل ها بسیار زیاد است