Open dbrizov opened 6 years ago
Tooltip
still does not work with MinMaxSlider
verifying this is still an issue with MinMaxSlider
still reproducible
I know it's still reproducible, but I don't know how to fix it. I am just implementing a CustomPropertyDrawer
like everything else. It has to do something with the MinMaxSlider
which Unity provides
I noticed this with the MinValue and MaxValue as well.
Maybe this helps?
I noticed this with the MinValue and MaxValue as well.
Maybe this helps?
This is exactly what is happening, some EditorGUILayout
functions support tooltips, some don't. I won't be able to fix this bug unless I have Unity's source code.
The other solution is to check manually if the properties have [Tooltip]
attribute, and add the tooltip myself, but that means I have to make special cases all around the code, because I don't want to display 2 tooltips for the drawers that already support 1 tooltip. Actually, 2 tooltips can't happen, but 2 spaces because of the [Space]
attribute can.
Hi, the problem with the tooltip can be fixed with the code on the answer link. I have tried with my custom propertyDrawer, it works like a charm: If you update the codes it'll be fixed properly, link: http://answers.unity.com/answers/1544468/view.html
@neohun thx! That set me on the right path. So, for me at least, I was able to fix this issue by removing the label
parameter in EditorGUILayout.PropertyField
calls. Not sure if this can interfere with some other NaughtyAttributes, but now my foldouts no longer disable tooltips.
@neohun thx! That set me on the right path. So, for me at least, I was able to fix this issue by removing the
label
parameter inEditorGUILayout.PropertyField
calls. Not sure if this can interfere with some other NaughtyAttributes, but now my foldouts no longer disable tooltips.
Glad to hear that, actually all problems caused by unity's terrible custom editor system but anyway (:
Any update on this issue, it seems tooltips are still not working. For me it doesnt show tooltips with any property that I use NaughtyAttributes tags
@ZnelArts Hi, It seems that unity has done some changes and this problem is fixed. If you upgrade your editor to an upper version it should work. I use unity 2019.4.39 and it works without any problem at least for now.. link: https://issuetracker.unity3d.com/issues/tooltips-are-not-shown-when-hovering-over-name-of-the-value-in-the-inspector
I'm using 2020.3.25f1 but the issue still exists. I'm using Label
and ShowIf
for some fields but then the fields with Tooltip
doesn't show the tooltips even that field doesn't use any NaughtyAttribute.
Well, it works for my version of the editor I have no idea why it does not work for you maybe use another version and check again.
Got it to work with a simple solution, I hope this is the same problem you're having.
In PropertyUtility.cs, in function GUIContent GetLabel(SerializedProperty property)
Line 36. Replace "GUIContent label = new GUIContent(labelText);"
with: GUIContent label = new GUIContent(labelText, property.tooltip);
Now my tooltips are visible, if the script uses NaughtyAttributes (at least min and max value ones). Weird that the problem persisted even for field that didn't use NaughtyAttributes - it was enough for any field to use NaughtyAttributes for all fields' tooltips to become disabled
When tooltips didn't work for me on the MinMaxSlider I edited the MinMaxPropertyDrawer in the following way:
EditorGUI.LabelField(labelRect, property.displayName);
// line 48... became ...
TooltipAttribute tooltipAttribute = PropertyUtility.GetAttribute<TooltipAttribute>(property); EditorGUI.LabelField(labelRect, new GUIContent(property.displayName, tooltipAttribute != null ? tooltipAttribute.tooltip : ""));