mirror of
https://github.com/unity-atoms/unity-atoms.git
synced 2025-01-21 23:58:49 -05:00
Fix hasChildren display in AtomReferences
The display of an AtomReference would act a bit weird if the Atom was of e.g. a serializable class.
This commit is contained in:
parent
7b29e15be2
commit
1c617ae397
@ -67,16 +67,12 @@ namespace UnityAtoms.Editor
|
||||
var newUsageValue = EditorGUI.Popup(buttonRect, currentUsage.intValue, GetPopupOptions(property), _popupStyle);
|
||||
currentUsage.intValue = newUsageValue;
|
||||
|
||||
|
||||
var usageTypePropertyName = GetUsages(property)[newUsageValue].PropertyName;
|
||||
var usageTypeProperty = property.FindPropertyRelative(usageTypePropertyName);
|
||||
|
||||
|
||||
var valueFieldHeight = EditorGUI.GetPropertyHeight(property.FindPropertyRelative(usageTypePropertyName), label);
|
||||
|
||||
if (usageTypePropertyName == "_value" && valueFieldHeight > EditorGUIUtility.singleLineHeight+2)
|
||||
if (usageTypePropertyName == "_value")
|
||||
{
|
||||
EditorGUI.PropertyField(originalPosition, usageTypeProperty, GUIContent.none, true);
|
||||
EditorGUI.PropertyField(usageTypeProperty.hasChildren ? originalPosition : position, usageTypeProperty, GUIContent.none, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user