Search Unity

Bug Port inspector attributes does not work

Discussion in 'Visual Scripting' started by JacobFast, Apr 30, 2022.

  1. JacobFast

    JacobFast

    Joined:
    Apr 29, 2014
    Posts:
    47
    [DoNotSerialize]
    [InspectorTextArea]
    public ValueInput string;

    InspectorTextArea - attribute ignored.

    the reason is in file stringInspector.cs
    if (metadata.HasAttribute<InspectorTextAreaAttribute>()) this one always returns false

    if i change to this
    if (metadata.HasAncestorAttribute<InspectorTextAreaAttribute>()) - does work

    same thing for every other inspector attribute.

    BTW this is the solution for anyone who wants to add multi line support. change all
    metadata.HasAttribute<InspectorTextAreaAttribute>)_ to
    metadata.HasAncestorAttribute<InspectorTextAreaAttribute>()
    in stringInspector.cs
     
    Last edited: Apr 30, 2022