tanghai 8 лет назад
Родитель
Сommit
9b5d684044

+ 14 - 1
Unity/Assets/Scripts/Base/Object/ObjectEvents.cs

@@ -43,7 +43,20 @@ namespace Model
 			}
 		}
 
-		public Assembly HotfixAssembly;
+		private Assembly hotfixAssembly;
+
+		public Assembly HotfixAssembly
+		{
+			get
+			{
+				return this.hotfixAssembly;
+			}
+			set
+			{
+				this.hotfixAssembly = value;
+				this.Load();
+			}
+		}
 
 		private readonly Dictionary<string, Assembly> assemblies = new Dictionary<string, Assembly>();
 

+ 4 - 0
Unity/Assets/Scripts/Helper/DllHelper.cs

@@ -46,6 +46,10 @@ namespace Model
 
 			return appDomain.LoadedTypes.Values.Select(x => x.ReflectionType).ToArray();
 #else
+			if (ObjectEvents.Instance.HotfixAssembly == null)
+			{
+				return new Type[0];
+			}
 			return ObjectEvents.Instance.HotfixAssembly.GetTypes();
 #endif
 		}