Przeglądaj źródła

修复Entity EndInit接口

tanghai 8 lat temu
rodzic
commit
c556e9a6e0
1 zmienionych plików z 10 dodań i 0 usunięć
  1. 10 0
      Unity/Assets/Scripts/Object/Entity.cs

+ 10 - 0
Unity/Assets/Scripts/Object/Entity.cs

@@ -176,5 +176,15 @@ namespace Model
 		{
 		{
 			return components.ToArray();
 			return components.ToArray();
 		}
 		}
+
+		public override void EndInit()
+		{
+			base.EndInit();
+
+			foreach (Component component in this.components)
+			{
+				this.componentDict.Add(component.GetType(), component);
+			}
+		}
 	}
 	}
 }
 }