EduardMalkhasyan / Serializable-Dictionary-Unity

Create a serializable dictionary in Unity with all necessary error detections
MIT License
38 stars 3 forks source link

Label mispositioned (appears on top of the foldout arrow) in Unity 6 Preview 6.0.7 #4

Closed yxx10 closed 3 months ago

yxx10 commented 3 months ago

Perhaps an issue with an API change, but in Unity 6.0.7 (which is still in preview), the label from the foldout appears on top of the arrow. Can be worked around by just making this change to the DisplayName method in the SerializableDictionaryDrawer class:

GUI.color = Color.white;
//GUI.Label(headerRect, prop.displayName); <- original

var labelRect = headerRect;
labelRect.x += 12;
GUI.Label(labelRect, prop.displayName); // <- workaround

GUI.color = Color.white;
GUI.skin.label.fontSize = 12;
GUI.skin.label.fontStyle = FontStyle.Normal;
GUI.skin.label.alignment = TextAnchor.MiddleLeft;
EduardMalkhasyan commented 3 months ago

Ok thanks @yxx10 I will check today!

EduardMalkhasyan commented 3 months ago

Hello @yxx10 new version has the fix - V_2_02

Works for 2021, 2022 and above

Your right there was API change for 2022 and above, thanks for advice!