Skip to content

Commit

Permalink
修正默认选中类型
Browse files Browse the repository at this point in the history
  • Loading branch information
KumoKyaku committed Dec 31, 2023
1 parent 22a6c39 commit 0af98f4
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,9 @@ public void CacheSupportType(SerializedProperty property)
SupportTypes = new Type[allTypes.Count + 1];

var currentType = property.managedReferenceValue?.GetType();
DropMenuIndex = allTypes.Count;

var indexCacheKey = (property.serializedObject.targetObject, property.propertyPath);
SelectedIndex[indexCacheKey] = allTypes.Count;

foreach (var item in allTypes)
{
Expand All @@ -506,7 +508,7 @@ public void CacheSupportType(SerializedProperty property)

if (currentType == item)
{
this.DropMenuIndex = index;
SelectedIndex[indexCacheKey] = index;
}
index++;
}
Expand Down

0 comments on commit 0af98f4

Please sign in to comment.