public static void Initialize(Type entityType, DTEntity entity) { if (entity.Initialized) { return; } FieldInfo[] componentFields = DTEntityInitializer.GetComponentFields(entityType); foreach (FieldInfo componentField in componentFields) { object component = componentField.GetValue(entity); entity.AddComponent(componentField.FieldType, component); } entity.FinishInitializing(); }