tanghai 8 лет назад
Родитель
Сommit
c556e9a6e0
1 измененных файлов с 10 добавлено и 0 удалено
  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();
 		}
+
+		public override void EndInit()
+		{
+			base.EndInit();
+
+			foreach (Component component in this.components)
+			{
+				this.componentDict.Add(component.GetType(), component);
+			}
+		}
 	}
 }