private void GetComponent(FieldInfo field) { GetComponentAttribute[] getComponentAttributes = (GetComponentAttribute[])field.GetCustomAttributes(typeof(GetComponentAttribute), true); foreach (var attribute in getComponentAttributes) { ComponentGetter getter = ComponentGetterDatabase.GetComponentGetterForAttribute(attribute.GetType()); if (getter != null) { //getter.GetComponent(this.target, field, attribute); getter.GetComponent(this.serializedPropertiesByFieldName[field.Name], field, attribute); } } }
static ComponentGetterDatabase() { gettersByAttributeType = new Dictionary <Type, ComponentGetter>(); gettersByAttributeType[typeof(GetComponentAttribute)] = new ComponentGetter(); }