Troubling Tool Tips

Hi,

I have a slight issue with the tool tip attribute, and frankly will be impressed if somebody knows a solution.

–The tool tip attribute allows tool tips to be drawn when you mouse over fields in the inspector

My problem is I have attribute A, which I want to alter what the tool tip says.

In my draw code for attribute A I do something like this:

object[] atrs = fieldInfo.GetCustomAttributes(typeof(TooltipAttribute), false);

if (atrs.Length > 0 )

oldTT = ((TooltipAttribute)atrs[0]).tooltip;

label.tooltip = oldTT + "\n" + "more ToolTipText";

This works fine.

HOWEVER The order the draw for the tool tip or attribute A gets called in (seems to be) is random.

Therefore if the tool tip drawer gets called first, then Attribute A never gets to alter the Tool Tip’s text, and the original Tool tip will display.
And if Atribute A’s drawer gets called first, it works as intended.

Is there a solution for this.

I understand there is an order parameter, this is for decoration drawers, and tool tip and Attribute A are not decoration.

Additionally, the order which the attributes are called in seems to happen on compile.

Furthermore the following code is identical

[AttributeA]
[tooltip]
public float a;

[tooltip]
[AttributeA]
public float b;

I wound up using an index. Headache Gone! ;D

But This means I would make my own read only attribute :frowning:

I guess it [mytooltip(…)] wouldn’t do anything (no or empty drawer). The only purpose would be to store a string which [AttributeA] would then get the string and set the tooltip on the property.