Update Editor/PropertyDrawer/SerializableFuncBasePropertyDrawer.cs

This commit is contained in:
2025-11-03 07:36:58 +00:00
parent a1e3174bc1
commit f1e2a3beb1

View File

@@ -442,6 +442,13 @@ namespace UnityUtilities.SerializableDataHelpers.UnityEditorUtilities
genericMenu.AddSeparator(""); genericMenu.AddSeparator("");
Type[] funcParameters = GetFuncTypeArguments(data.FuncProperty); Type[] funcParameters = GetFuncTypeArguments(data.FuncProperty);
if (target is ScriptableObject targetScriptableObject)
{
DrawMenuForComponent(genericMenu, data, targetScriptableObject, funcParameters);
return genericMenu;
}
Component[] components = ((GameObject)target).GetComponents<Component>(); Component[] components = ((GameObject)target).GetComponents<Component>();
DrawMenuForComponent(genericMenu, data, (GameObject)target, funcParameters); DrawMenuForComponent(genericMenu, data, (GameObject)target, funcParameters);