Example #1
0
 private PropertyDrawer GetPropertyDrawerForField(FieldInfo field)
 {
     DrawerAttribute[] drawerAttributes = (DrawerAttribute[])field.GetCustomAttributes(typeof(DrawerAttribute), true);
     if (drawerAttributes.Length > 0)
     {
         PropertyDrawer drawer = PropertyDrawerDatabase.GetDrawerForAttribute(drawerAttributes[0].GetType());
         return(drawer);
     }
     else
     {
         return(null);
     }
 }
Example #2
0
 protected PropertyDrawer GetPropertyDrawerForField(FieldInfo field)
 {
     DrawerAttribute[] drawerAttributes = (DrawerAttribute[])field.GetCustomAttributes(typeof(DrawerAttribute), true);
     if (drawerAttributes.Length > 0)
     {
         var            attr   = drawerAttributes[0].GetType();
         PropertyDrawer drawer = PropertyDrawerDatabase.GetDrawerForAttribute(attr);
         if (drawer == null)
         {
             Debug.LogError($"DrawerAttribute: {attr.GetType().Name} is defined, but coresponding Drawer is missing. [Update Attribute Database] may fixed this.");
             return(null);
         }
         return(drawer.Clone());
     }
     else
     {
         return(null);
     }
 }