Преглед изворни кода

修复Entity EndInit接口

tanghai пре 8 година
родитељ
комит
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);
+			}
+		}
 	}
 }