Skip to content

Commit d5b0922

Browse files
authored
Merge pull request #1 from VPDPersonal/Bug/Fix-AssetPath-In-Prefab-Mode
Fix empty assetPath
2 parents 0b4a582 + 30a816a commit d5b0922

File tree

1 file changed

+15
-7
lines changed

1 file changed

+15
-7
lines changed

Editor/Dropdown/SerializeReferencePropertyDrawer_UIToolkit.cs

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -159,14 +159,22 @@ void RefreshDropdown(SerializedObject so)
159159
var selectedType = TypeUtils.ExtractTypeFromString(prop.managedReferenceFullTypename);
160160
var selectedTypeName = GetTypeName(selectedType);
161161
var tooltipText = $"Type Full Name: {selectedType?.FullName}";
162-
var isMissingType = TryGetMissingType(property, assetPath, out var missingType);
163-
if (isMissingType)
162+
163+
var isMissingType = false;
164+
165+
if (string.IsNullOrEmpty(assetPath))
164166
{
165-
selectedTypeName = $"MISSING TYPE: {missingType.className}";
166-
tooltipText = missingType.GetDetailData();
167-
selectTypeButton.AddToClassList("error-bg");
167+
isMissingType = TryGetMissingType(property, assetPath, out var missingType);
168+
169+
if (isMissingType)
170+
{
171+
selectedTypeName = $"MISSING TYPE: {missingType.className}";
172+
tooltipText = missingType.GetDetailData();
173+
selectTypeButton.AddToClassList("error-bg");
174+
}
168175
}
169-
else
176+
177+
if (!isMissingType)
170178
{
171179
selectTypeButton.RemoveFromClassList("error-bg");
172180
}
@@ -250,4 +258,4 @@ void ShowModifyWindow(TypeData typeData, long refId)
250258
}
251259
}
252260
}
253-
}
261+
}

0 commit comments

Comments
 (0)