فهرست منبع

整理代码,Entry只有一个,客户端代码跟服务端代码改成订阅的形式,订阅跟Callback的区别是
订阅的事件抛出去不关心谁使用,可以没人使用,可以任何模块都订阅,抛出的地方完全不关心。
Callback则跟调用函数一样,使用者必须知道调用了谁,那为啥不用函数呢,因为程序集引用的关系,
无法直接调用到对应的方法,ET的callback还可以根据Id分发,这个也是对比Publish不同的地方,
一定要好好区分两者的区别。

tanghai 3 سال پیش
والد
کامیت
8a48c8902c
25فایلهای تغییر یافته به همراه150 افزوده شده و 197 حذف شده
  1. 0 0
      Config/NLog/NLog.config
  2. 0 0
      Config/NLog/NLog.xsd
  3. 32 6
      DotNet/App/CodeLoader.cs
  4. 1 1
      DotNet/App/ConfigLoader.cs
  5. 0 6
      DotNet/App/DotNet.App.csproj
  6. 9 12
      DotNet/App/Init.cs
  7. 3 1
      DotNet/App/ReloadDllConsoleHandler.cs
  8. 15 14
      Unity/Assets/Scenes/Init.unity
  9. 3 3
      Unity/Assets/Scripts/Codes/Hotfix/Server/Demo/EntryEvent2_InitServer.cs
  10. 1 1
      Unity/Assets/Scripts/Codes/Hotfix/Server/Demo/EntryEvent2_InitServer.cs.meta
  11. 3 3
      Unity/Assets/Scripts/Codes/Hotfix/Share/Demo/EntryEvent1_InitShare.cs
  12. 1 1
      Unity/Assets/Scripts/Codes/Hotfix/Share/Demo/EntryEvent1_InitShare.cs.meta
  13. 3 3
      Unity/Assets/Scripts/Codes/HotfixView/Client/Demo/EntryEvent3_InitClient.cs
  14. 1 1
      Unity/Assets/Scripts/Codes/HotfixView/Client/Demo/EntryEvent3_InitClient.cs.meta
  15. 0 16
      Unity/Assets/Scripts/Codes/Model/Server/Entry.cs
  16. 0 11
      Unity/Assets/Scripts/Codes/Model/Server/Entry.cs.meta
  17. 34 0
      Unity/Assets/Scripts/Codes/Model/Share/Entry.cs
  18. 1 1
      Unity/Assets/Scripts/Codes/Model/Share/Entry.cs.meta
  19. 0 15
      Unity/Assets/Scripts/Codes/Model/Share/InitCallback.cs
  20. 0 11
      Unity/Assets/Scripts/Codes/Model/Share/InitCallback.cs.meta
  21. 1 1
      Unity/Assets/Scripts/Codes/Model/Share/TimerCallbackId.cs
  22. 0 61
      Unity/Assets/Scripts/Codes/ModelView/Client/Entry.cs
  23. 19 19
      Unity/Assets/Scripts/Mono/CodeLoader.cs
  24. 22 9
      Unity/Assets/Scripts/Mono/MonoBehaviour/Init.cs
  25. 1 1
      Unity/Assets/Scripts/Mono/MonoBehaviour/Init.cs.meta

+ 0 - 0
DotNet/App/NLog.config → Config/NLog/NLog.config


+ 0 - 0
DotNet/App/NLog.xsd → Config/NLog/NLog.xsd


+ 32 - 6
DotNet/App/CodeLoader.cs

@@ -4,14 +4,40 @@ using System.IO;
 using System.Reflection;
 using System.Runtime.Loader;
 
-namespace ET.Server
+namespace ET
 {
-    public class CodeLoader
+    public class CodeLoader: IDisposable
     {
-        public static CodeLoader Instance { get; set; } = new CodeLoader();
-        
         private AssemblyLoadContext assemblyLoadContext;
         
+        private Assembly hotfix;
+        
+        private static CodeLoader instance;
+		
+        public static CodeLoader Instance 
+        {
+            get
+            {
+                return instance ??= new CodeLoader();
+            }
+        }
+
+        private CodeLoader()
+        {
+        }
+		
+        public void Dispose()
+        {
+            instance = null;
+        }
+
+        public void Start()
+        {
+            this.LoadHotfix();
+            
+            Entry.Start();
+        }
+
         public void LoadHotfix()
         {
             assemblyLoadContext?.Unload();
@@ -19,9 +45,9 @@ namespace ET.Server
             assemblyLoadContext = new AssemblyLoadContext("Hotfix", true);
             byte[] dllBytes = File.ReadAllBytes("./Hotfix.dll");
             byte[] pdbBytes = File.ReadAllBytes("./Hotfix.pdb");
-            Assembly assembly = assemblyLoadContext.LoadFromStream(new MemoryStream(dllBytes), new MemoryStream(pdbBytes));
+            this.hotfix = assemblyLoadContext.LoadFromStream(new MemoryStream(dllBytes), new MemoryStream(pdbBytes));
             
-            Dictionary<string, Type> types = AssemblyHelper.GetAssemblyTypes(typeof(Program).Assembly, typeof (Game).Assembly, typeof(Entry).Assembly, assembly);
+            Dictionary<string, Type> types = AssemblyHelper.GetAssemblyTypes(typeof(Init).Assembly, typeof (Game).Assembly, typeof(Entry).Assembly, this.hotfix);
 			
             Game.EventSystem.Add(types);
         }

+ 1 - 1
DotNet/App/ConfigLoader.cs

@@ -2,7 +2,7 @@ using System;
 using System.Collections.Generic;
 using System.IO;
 
-namespace ET.Server
+namespace ET
 {
     [Callback]
     public class GetAllConfigBytes: ACallbackHandler<ConfigComponent.GetAllConfigBytes, Dictionary<string, byte[]>>

+ 0 - 6
DotNet/App/DotNet.App.csproj

@@ -34,10 +34,4 @@
   <ItemGroup>
     <ProjectReference Include="..\Model\DotNet.Model.csproj" />
   </ItemGroup>
-
-  <ItemGroup>
-    <Compile Update="ReloadDllConsoleHandler.cs">
-      <Link>Server\Module\Console\ReloadDllConsoleHandler.cs</Link>
-    </Compile>
-  </ItemGroup>
 </Project>

+ 9 - 12
DotNet/App/Program.cs → DotNet/App/Init.cs

@@ -3,9 +3,9 @@ using System.Threading;
 using CommandLine;
 using NLog;
 
-namespace ET.Server
+namespace ET
 {
-	internal static class Program
+	internal static class Init
 	{
 		private static void Main(string[] args)
 		{
@@ -18,8 +18,6 @@ namespace ET.Server
 				
 				// 异步方法全部会回掉到主线程
 				SynchronizationContext.SetSynchronizationContext(ThreadSynchronizationContext.Instance);
-			
-				
 				
 				// 命令行参数
 				Options options = null;
@@ -28,19 +26,18 @@ namespace ET.Server
 						.WithParsed(o => { options = o; });
 				Options.Instance = options;
 				
-				Game.ILog = new NLogger(Game.Options.AppType.ToString());
+				LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration("../Config/NLog/NLog.config");
 				LogManager.Configuration.Variables["appIdFormat"] = $"{Game.Options.Process:000000}";
+				LogManager.Configuration.Variables["currentDir"] = Environment.CurrentDirectory;
+				
+				Game.ILog = new NLogger(Game.Options.AppType.ToString());
 				
 				ETTask.ExceptionHandler += Log.Error;
+			
+				CodeLoader.Instance.Start();
 
-				CodeLoader.Instance.LoadHotfix();
-				
-				MongoHelper.Register(Game.EventSystem.GetTypes());
-				
 				Log.Console($"app start: {Game.Scene.Id} options: {JsonHelper.ToJson(Game.Options)} ");
-				
-				Entry.Start();
-				
+
 				while (true)
 				{
 					try

+ 3 - 1
DotNet/App/ReloadDllConsoleHandler.cs

@@ -1,4 +1,6 @@
-namespace ET.Server
+using ET.Server;
+
+namespace ET
 {
     [ConsoleHandler(ConsoleMode.ReloadDll)]
     public class ReloadDllConsoleHandler: IConsoleHandler

+ 15 - 14
Unity/Assets/Scenes/Init.unity

@@ -253,6 +253,7 @@ MonoBehaviour:
   m_Script: {fileID: 11500000, guid: 4f231c4fb786f3946a6b90b886c48677, type: 3}
   m_Name: 
   m_EditorClassIdentifier: 
+  m_SendPointerHoverToParent: 1
   m_HorizontalAxis: Horizontal
   m_VerticalAxis: Vertical
   m_SubmitButton: Submit
@@ -400,7 +401,7 @@ GameObject:
   m_Component:
   - component: {fileID: 575235020}
   - component: {fileID: 575235022}
-  - component: {fileID: 575235019}
+  - component: {fileID: 575235023}
   m_Layer: 0
   m_Name: Global
   m_TagString: Untagged
@@ -408,19 +409,6 @@ GameObject:
   m_NavMeshLayer: 0
   m_StaticEditorFlags: 0
   m_IsActive: 1
---- !u!114 &575235019
-MonoBehaviour:
-  m_ObjectHideFlags: 0
-  m_CorrespondingSourceObject: {fileID: 0}
-  m_PrefabInstance: {fileID: 0}
-  m_PrefabAsset: {fileID: 0}
-  m_GameObject: {fileID: 575235018}
-  m_Enabled: 1
-  m_EditorHideFlags: 0
-  m_Script: {fileID: 11500000, guid: ff906ecbbd0163f4094f8fa4e305d39f, type: 3}
-  m_Name: 
-  m_EditorClassIdentifier: 
-  GlobalConfig: {fileID: 11400000, guid: a60778dce43da574aa447ab3fcf5d9f7, type: 2}
 --- !u!4 &575235020
 Transform:
   m_ObjectHideFlags: 0
@@ -456,6 +444,19 @@ MonoBehaviour:
   - key: Unit
     gameObject: {fileID: 1610378981859644, guid: cfaf4529ce2243c4c85126e9d008897b,
       type: 3}
+--- !u!114 &575235023
+MonoBehaviour:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 575235018}
+  m_Enabled: 1
+  m_EditorHideFlags: 0
+  m_Script: {fileID: 11500000, guid: 3b3cb9b07d7917f4cbf5bc2be18e8585, type: 3}
+  m_Name: 
+  m_EditorClassIdentifier: 
+  GlobalConfig: {fileID: 11400000, guid: a60778dce43da574aa447ab3fcf5d9f7, type: 2}
 --- !u!1 &630054495
 GameObject:
   m_ObjectHideFlags: 0

+ 3 - 3
Unity/Assets/Scripts/Codes/Hotfix/Server/Demo/InitServer.cs → Unity/Assets/Scripts/Codes/Hotfix/Server/Demo/EntryEvent2_InitServer.cs

@@ -2,10 +2,10 @@ using System.Net;
 
 namespace ET.Server
 {
-    [Callback(InitCallbackId.InitServer)]
-    public class InitServer: ACallbackHandler<InitCallback, ETTask>
+    [Event(SceneType.Process)]
+    public class EntryEvent2_InitServer: AEvent<ET.EventType.EntryEvent2>
     {
-        public override async ETTask Handle(InitCallback args)
+        protected override async ETTask Run(Scene scene, ET.EventType.EntryEvent2 args)
         {
             // 发送普通actor消息
             Game.Scene.AddComponent<ActorMessageSenderComponent>();

+ 1 - 1
Unity/Assets/Scripts/Codes/Hotfix/Share/Demo/InitShare.cs.meta → Unity/Assets/Scripts/Codes/Hotfix/Server/Demo/EntryEvent2_InitServer.cs.meta

@@ -1,5 +1,5 @@
 fileFormatVersion: 2
-guid: 5dae38d0c51b749438fae1d4862eb9a0
+guid: fbae920cec1121b49895edbe741cddea
 MonoImporter:
   externalObjects: {}
   serializedVersion: 2

+ 3 - 3
Unity/Assets/Scripts/Codes/Hotfix/Share/Demo/InitShare.cs → Unity/Assets/Scripts/Codes/Hotfix/Share/Demo/EntryEvent1_InitShare.cs

@@ -1,9 +1,9 @@
 namespace ET
 {
-    [Callback(InitCallbackId.InitShare)]
-    public class InitShare: ACallbackHandler<InitCallback, ETTask>
+    [Event(SceneType.Process)]
+    public class EntryEvent1_InitShare: AEvent<EventType.EntryEvent1>
     {
-        public override async ETTask Handle(InitCallback args)
+        protected override async ETTask Run(Scene scene, EventType.EntryEvent1 args)
         {
             Game.Scene.AddComponent<TimerComponent>();
             Game.Scene.AddComponent<OpcodeTypeComponent>();

+ 1 - 1
Unity/Assets/Scripts/Codes/HotfixView/Client/Demo/InitClient.cs.meta → Unity/Assets/Scripts/Codes/Hotfix/Share/Demo/EntryEvent1_InitShare.cs.meta

@@ -1,5 +1,5 @@
 fileFormatVersion: 2
-guid: d16dbdeea966aa54a8a404e90246de60
+guid: 3b2fe8f75cd4aa2459ff9343ff59afc3
 MonoImporter:
   externalObjects: {}
   serializedVersion: 2

+ 3 - 3
Unity/Assets/Scripts/Codes/HotfixView/Client/Demo/InitClient.cs → Unity/Assets/Scripts/Codes/HotfixView/Client/Demo/EntryEvent3_InitClient.cs

@@ -3,10 +3,10 @@ using System.IO;
 
 namespace ET.Client
 {
-    [Callback(InitCallbackId.InitClient)]
-    public class InitClient: ACallbackHandler<InitCallback, ETTask>
+    [Event(SceneType.Process)]
+    public class EntryEvent3_InitClient: AEvent<ET.EventType.EntryEvent3>
     {
-        public override async ETTask Handle(InitCallback args)
+        protected override async ETTask Run(Scene scene, ET.EventType.EntryEvent3 args)
         {
             // 加载配置
             Game.Scene.AddComponent<ResourcesComponent>();

+ 1 - 1
Unity/Assets/Scripts/Codes/Hotfix/Server/Demo/InitServer.cs.meta → Unity/Assets/Scripts/Codes/HotfixView/Client/Demo/EntryEvent3_InitClient.cs.meta

@@ -1,5 +1,5 @@
 fileFormatVersion: 2
-guid: d8130d8442e2398419ec4e2bd0d90617
+guid: 3cf85e4ef07f541a4b8636fe1a20c8f9
 MonoImporter:
   externalObjects: {}
   serializedVersion: 2

+ 0 - 16
Unity/Assets/Scripts/Codes/Model/Server/Entry.cs

@@ -1,16 +0,0 @@
-namespace ET.Server
-{
-    public static class Entry
-    {
-        public static void Start()
-        {
-            StartAsync().Coroutine();
-        }
-        
-        private static async ETTask StartAsync()
-        {
-            await Game.EventSystem.Callback<InitCallback, ETTask>(new InitCallback() {Id = InitCallbackId.InitShare});
-            await Game.EventSystem.Callback<InitCallback, ETTask>(new InitCallback() {Id = InitCallbackId.InitServer});
-        }
-    }
-}

+ 0 - 11
Unity/Assets/Scripts/Codes/Model/Server/Entry.cs.meta

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

+ 34 - 0
Unity/Assets/Scripts/Codes/Model/Share/Entry.cs

@@ -0,0 +1,34 @@
+namespace ET
+{
+    namespace EventType
+    {
+        public struct EntryEvent1
+        {
+        }   
+        
+        public struct EntryEvent2
+        {
+        } 
+        
+        public struct EntryEvent3
+        {
+        } 
+    }
+    
+    public static class Entry
+    {
+        public static void Start()
+        {
+            MongoHelper.Register(Game.EventSystem.GetTypes());
+            
+            StartAsync().Coroutine();
+        }
+        
+        private static async ETTask StartAsync()
+        {
+            await Game.EventSystem.PublishAsync(Game.Scene, new EventType.EntryEvent1());
+            await Game.EventSystem.PublishAsync(Game.Scene, new EventType.EntryEvent2());
+            await Game.EventSystem.PublishAsync(Game.Scene, new EventType.EntryEvent3());
+        }
+    }
+}

+ 1 - 1
Unity/Assets/Scripts/Codes/ModelView/Client/Entry.cs.meta → Unity/Assets/Scripts/Codes/Model/Share/Entry.cs.meta

@@ -1,5 +1,5 @@
 fileFormatVersion: 2
-guid: a17d7be5cdd1c5849990ace17183858d
+guid: 59006ccfe1afa874f871e33783261da1
 MonoImporter:
   externalObjects: {}
   serializedVersion: 2

+ 0 - 15
Unity/Assets/Scripts/Codes/Model/Share/InitCallback.cs

@@ -1,15 +0,0 @@
-namespace ET
-{
-    [UniqueId(1,10000)]
-    public static class InitCallbackId
-    {
-        public const int InitShare = 1;
-        public const int InitClient = 2;
-        public const int InitServer = 3;
-    }
-    
-    public struct InitCallback: ICallback
-    {
-        public int Id { get; set; }
-    }
-}

+ 0 - 11
Unity/Assets/Scripts/Codes/Model/Share/InitCallback.cs.meta

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

+ 1 - 1
Unity/Assets/Scripts/Codes/Model/Share/TimerCallbackId.cs

@@ -1,7 +1,7 @@
 namespace ET
 {
     [UniqueId(1,10000)]
-    public class TimerCallbackId
+    public static class TimerCallbackId
     {
         // 框架层100-200,逻辑层的timer type从200起
         public const int WaitTimer = 100;

+ 0 - 61
Unity/Assets/Scripts/Codes/ModelView/Client/Entry.cs

@@ -1,61 +0,0 @@
-using System;
-using System.Threading;
-
-namespace ET.Client
-{
-	public static class Entry
-	{
-		public static void Start()
-		{
-			StartAsync().Coroutine();
-		}
-		
-		private static async ETTask StartAsync()
-		{
-			try
-			{
-				AppDomain.CurrentDomain.UnhandledException += (sender, e) =>
-				{
-					Log.Error(e.ExceptionObject.ToString());
-				};
-				
-				SynchronizationContext.SetSynchronizationContext(ThreadSynchronizationContext.Instance);
-				
-				CodeLoader.Instance.Update += Game.Update;
-				CodeLoader.Instance.LateUpdate += Game.LateUpdate;
-				CodeLoader.Instance.OnApplicationQuit += Game.Close;
-				
-				MongoHelper.Register(Game.EventSystem.GetTypes());
-				
-				Game.ILog = new UnityLogger();
-				
-				ETTask.ExceptionHandler += Log.Error;
-
-				Options.Instance = new Options();
-
-				await Game.EventSystem.Callback<InitCallback, ETTask>(new InitCallback() {Id = InitCallbackId.InitShare});
-				
-				switch (CodeLoader.Instance.GlobalConfig.CodeMode)
-				{
-					case CodeMode.Client:
-						await Game.EventSystem.Callback<InitCallback, ETTask>(new InitCallback() {Id = InitCallbackId.InitClient});
-						break;
-					case CodeMode.Server:
-						await Game.EventSystem.Callback<InitCallback, ETTask>(new InitCallback() {Id = InitCallbackId.InitServer});
-						break;
-					case CodeMode.ClientServer:
-						await Game.EventSystem.Callback<InitCallback, ETTask>(new InitCallback() {Id = InitCallbackId.InitServer});
-						await Game.EventSystem.Callback<InitCallback, ETTask>(new InitCallback() {Id = InitCallbackId.InitClient});
-						break;
-					default:
-						throw new ArgumentOutOfRangeException();
-				}
-				Log.Info("Init Finish!");
-			}
-			catch (Exception e)
-			{
-				Log.Error(e);
-			}
-		}
-	}
-}

+ 19 - 19
Unity/Assets/Scripts/Mono/CodeLoader.cs

@@ -8,32 +8,35 @@ namespace ET
 {
 	public class CodeLoader: IDisposable
 	{
-		public static CodeLoader Instance = new CodeLoader();
-
-		public Action Update;
-		public Action LateUpdate;
-		public Action OnApplicationQuit;
-
 		private Assembly assembly;
-
-		public GlobalConfig GlobalConfig;
+		
+		private static CodeLoader instance;
+		
+		public static CodeLoader Instance 
+		{
+			get
+			{
+				return instance ??= new CodeLoader();
+			}
+		}
 
 		private CodeLoader()
 		{
 		}
-
+		
 		public void Dispose()
 		{
+			instance = null;
 		}
-		
+
 		public void Start()
 		{
 			if (Define.EnableCodes)
 			{
-				this.GlobalConfig.LoadMode = LoadMode.Codes;
+				Init.Instance.GlobalConfig.LoadMode = LoadMode.Codes;
 			}
 			
-			switch (this.GlobalConfig.LoadMode)
+			switch (Init.Instance.GlobalConfig.LoadMode)
 			{
 				case LoadMode.Mono:
 				{
@@ -52,8 +55,6 @@ namespace ET
 					Dictionary<string, Type> types = AssemblyHelper.GetAssemblyTypes(typeof (Game).Assembly, this.assembly);
 					Game.EventSystem.Add(types);
 					
-					IStaticMethod start = new StaticMethod(assembly, "ET.Client.Entry", "Start");
-					start.Run();
 					break;
 				}
 				case LoadMode.Reload:
@@ -68,8 +69,6 @@ namespace ET
 					
 					assembly = Assembly.Load(assBytes, pdbBytes);
 					this.LoadHotfix();
-					IStaticMethod start = new StaticMethod(assembly, "ET.Client.Entry", "Start");
-					start.Run();
 					break;
 				}
 				case LoadMode.Codes:
@@ -90,11 +89,12 @@ namespace ET
 							this.assembly = ass;
 						}
 					}
-					IStaticMethod start = new StaticMethod(assembly, "ET.Client.Entry", "Start");
-					start.Run();
 					break;
 				}
 			}
+			
+			IStaticMethod start = new StaticMethod(assembly, "ET.Entry", "Start");
+			start.Run();
 		}
 
 		// 热重载调用下面两个方法
@@ -102,7 +102,7 @@ namespace ET
 		// Game.EventSystem.Load();
 		public void LoadHotfix()
 		{
-			if (this.GlobalConfig.LoadMode != LoadMode.Reload)
+			if (Init.Instance.GlobalConfig.LoadMode != LoadMode.Reload)
 			{
 				throw new Exception("CodeMode != Reload!");
 			}

+ 22 - 9
Unity/Assets/Scripts/Mono/MonoBehaviour/Init.cs

@@ -1,37 +1,50 @@
-using System.Threading;
+using System;
+using System.Threading;
 using UnityEngine;
 
 namespace ET
 {
 	public class Init: MonoBehaviour
 	{
+		public static Init Instance;
+		
 		public GlobalConfig GlobalConfig;
 		
 		private void Awake()
 		{
+			Instance = this;
+			
 			DontDestroyOnLoad(gameObject);
+			
+			AppDomain.CurrentDomain.UnhandledException += (sender, e) =>
+			{
+				Log.Error(e.ExceptionObject.ToString());
+			};
+				
+			SynchronizationContext.SetSynchronizationContext(ThreadSynchronizationContext.Instance);
+			
+			Game.ILog = new UnityLogger();
+				
+			ETTask.ExceptionHandler += Log.Error;
 
-			CodeLoader.Instance.GlobalConfig = this.GlobalConfig;
-		}
-
-		private void Start()
-		{
+			Options.Instance = new Options();
+			
 			CodeLoader.Instance.Start();
 		}
 
 		private void Update()
 		{
-			CodeLoader.Instance.Update();
+			Game.Update();
 		}
 
 		private void LateUpdate()
 		{
-			CodeLoader.Instance.LateUpdate();
+			Game.LateUpdate();
 		}
 
 		private void OnApplicationQuit()
 		{
-			CodeLoader.Instance.OnApplicationQuit();
+			Game.Close();
 			CodeLoader.Instance.Dispose();
 		}
 	}

+ 1 - 1
Unity/Assets/Scripts/Mono/MonoBehaviour/Init.cs.meta

@@ -1,5 +1,5 @@
 fileFormatVersion: 2
-guid: ff906ecbbd0163f4094f8fa4e305d39f
+guid: 3b3cb9b07d7917f4cbf5bc2be18e8585
 MonoImporter:
   externalObjects: {}
   serializedVersion: 2