Browse Source

1.Game.Close中EventSystem要在最后置空,否则Scene Dispose的时候会触发DestroySystem,再次new EventSystem
2.ComponentView在显示属性名字的时候去掉k__BackingField

tanghai 6 years ago
parent
commit
212109eea0

+ 3 - 1
Server/Model/Entity/Game.cs

@@ -41,8 +41,10 @@
 		{
 			scene.Dispose();
 			scene = null;
-			eventSystem = null;
+					
 			objectPool = null;
+			
+			eventSystem = null;
 		}
 	}
 }

+ 6 - 2
Unity/Assets/Editor/ComponentViewEditor/ComponentViewEditor.cs

@@ -5,7 +5,6 @@ using ETModel;
 using ILRuntime.Runtime.Intepreter;
 using UnityEditor;
 using UnityEngine;
-using Component = ETModel.Component;
 
 namespace ETEditor
 {
@@ -74,7 +73,12 @@ namespace ETEditor
                             continue;
                         }
 
-                        value = typeDrawer.DrawAndGetNewValue(type, fieldInfo.Name, value, null);
+                        string fieldName = fieldInfo.Name;
+                        if (fieldName.Length > 17 && fieldName.Contains("k__BackingField"))
+                        {
+                            fieldName = fieldName.Substring(1, fieldName.Length - 17);
+                        }
+                        value = typeDrawer.DrawAndGetNewValue(type, fieldName, value, null);
                         fieldInfo.SetValue(obj, value);
                         break;
                     }

+ 2 - 2
Unity/Assets/Hotfix/Entity/Game.cs

@@ -46,13 +46,13 @@ namespace ETHotfix
 
 		public static void Close()
 		{
-			eventSystem = null;
-			
 			scene?.Dispose();
 			scene = null;
 			
 			objectPool?.Dispose();
 			objectPool = null;
+			
+			eventSystem = null;
 		}
 	}
 }

+ 2 - 2
Unity/Assets/Model/Entity/Game.cs

@@ -56,8 +56,6 @@ namespace ETModel
 
 		public static void Close()
 		{
-			eventSystem = null;
-			
 			scene?.Dispose();
 			scene = null;
 			
@@ -65,6 +63,8 @@ namespace ETModel
 			objectPool = null;
 			
 			hotfix = null;
+			
+			eventSystem = null;
 		}
 	}
 }