コード例 #1
0
        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);
                }
            }
        }
コード例 #2
0
 static ComponentGetterDatabase()
 {
     gettersByAttributeType = new Dictionary <Type, ComponentGetter>();
     gettersByAttributeType[typeof(GetComponentAttribute)] = new ComponentGetter();
 }