'Padding' no longer displays in inspector (Horizontal Layout Group)

Issue #25 resolved
Matthew Smith created an issue

Normally it provides a small property drawer so you can adjust the padding.

Now it just displays a warning 'There is no custom drawer defined for type 'RectOffset', and the type has no members to draw.

Comments (6)

  1. Tor Esa Vestergaard
    • changed status to open

    This is a case (one of several we've had) where Unity's internal unmanaged code somehow breaks the rules, and creates properties for a type in a weird, unpredictable one-off way. Usually we just implement a new custom drawer for the given type that draws it properly, but I have a more general solution in mind that should also apply to the types that we don't have custom drawers for.

    I'm going to leave this issue open until that has been implemented.

  2. Tor Esa Vestergaard

    Spent most of today implementing the required functionality for this. RectOffset, and all other types like it (such as GUIStyle, etc) are now properly displayed in the inspector.

  3. Matthew Smith reporter

    I've had this come up again when it's trying to display something which doesn't have any serializable fields! Didn't want to make a new issue as not sure if it's something you've already fixed :)

  4. Tor Esa Vestergaard

    That would be a different issue than the one with RectOffset. The thing is, there are many cases where a drawer actually hasn't been defined, and needs to be - dictionaries, for example. We need to detect these cases, and the way we do it is we check if there's a custom drawer defined for the type, and if not, we check whether the type has any properties to display for our composite drawer. If the answer to both is no, we indicate that a drawer is missing.

    This isn't really behaviour that we want to change, because we do need to detect when a drawer is missing, but we can see the need to maybe add the ability to change it on a case-by-case basis.

    Can I ask, what is your specific case where you don't want it to do this?

  5. Matthew Smith reporter

    No specific case really - I'd just noticed that it happens and thought I'd make you guys aware of it, as it seemed (to me) to be an extension of the issue I'd reported yesterday.

  6. Log in to comment