Skip to content

Commit 52d0345

Browse files
committed
refresh button bugfix
1 parent 933a3bc commit 52d0345

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

Assets/Editor/Editor Windows/ScriptableObjectEditorWindow.cs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,14 @@ private void LoadAvailableTypes()
8383
{
8484
// Scan the "ScriptableObjects" folder to find all unique ScriptableObject types
8585
availableTypes = Resources.LoadAll<ScriptableObject>("ScriptableObjects").Select(t => t.GetType()).Distinct().ToList();
86-
selectedTypes.Intersect(availableTypes);
86+
if (selectedTypes.Count > 0)
87+
{
88+
selectedTypes.Intersect(availableTypes);
89+
}
90+
else
91+
{
92+
selectedTypes.AddRange(availableTypes);
93+
}
8794
}
8895

8996
private void GroupScriptableObjectsByType()
@@ -119,7 +126,6 @@ private void PutPropertiesForObject<T>(List<T> Configs) where T : ScriptableObje
119126
{
120127
// Show the name of each property as a label
121128
EditorGUILayout.LabelField(property.name, GUILayout.MinWidth(PropertyMinWidth));
122-
123129
// if any property is bigger than expected this will calculate extra space needed (ex: array properties can expand)
124130
if (property.isExpanded)
125131
GUILayout.Space(CalculatePropertyHeight(Configs, property) - EditorGUIUtility.singleLineHeight);

0 commit comments

Comments
 (0)