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

修复一个释放空GameObject的bug

tanghai 7 лет назад
Родитель
Сommit
fb95de24fc

+ 4 - 1
Unity/Assets/Hotfix/Base/Object/Component.cs

@@ -134,7 +134,10 @@ namespace ETHotfix
 			else
 			{
 #if !SERVER
-				UnityEngine.Object.Destroy(this.GameObject);
+				if (this.GameObject != null)
+				{
+					UnityEngine.Object.Destroy(this.GameObject);
+				}
 #endif
 			}
 		}

+ 0 - 8
Unity/Assets/Hotfix/UI.meta

@@ -1,8 +0,0 @@
-fileFormatVersion: 2
-guid: 43c537b5f05843f4bbd7e6255e1a040a
-folderAsset: yes
-DefaultImporter:
-  externalObjects: {}
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: 

+ 5 - 1
Unity/Assets/Model/Base/Object/Component.cs

@@ -138,7 +138,11 @@ namespace ETModel
 			else
 			{
 #if !SERVER
-				UnityEngine.Object.Destroy(this.GameObject);
+
+				if (this.GameObject != null)
+				{
+					UnityEngine.Object.Destroy(this.GameObject);
+				}
 #endif
 			}
 		}