TMPEffects icon indicating copy to clipboard operation
TMPEffects copied to clipboard

Crash in inspector when selecting a database asset

Open maarten-abbey opened this issue 5 months ago • 8 comments

I select a database asset, such as the provided TMPEffects/Resources/Databases/ShowAnimationDatabase.asset. The inspector shows nothing, and an error message is posted to the console.

TargetParameterCountException: Number of parameters specified does not match the expected number.

System.Reflection.RuntimeMethodInfo.ConvertValues (System.Reflection.Binder binder, System.Object[] args, System.Reflection.ParameterInfo[] pinfo, System.Globalization.CultureInfo culture, System.Reflection.BindingFlags invokeAttr) (at <46af11b490fa44239a17a904ee7462ef>:0)
System.Reflection.RuntimeMethodInfo.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <46af11b490fa44239a17a904ee7462ef>:0)
System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at <46af11b490fa44239a17a904ee7462ef>:0)
TMPEffects.SerializedCollections.Editor.SCEditorUtility.HasDrawerForType (System.Type type, System.Boolean isPropertyManagedReferenceType) (at ./Library/PackageCache/com.luca3317.tmpeffects/Runtime/SerializedDictionary/Editor/Scripts/Utility/SCEditorUtility.cs:109)
TMPEffects.SerializedCollections.Editor.SerializedDictionaryInstanceDrawer.CreateDisplaySettings (UnityEditor.SerializedProperty property, System.Type type) (at ./Library/PackageCache/com.luca3317.tmpeffects/Runtime/SerializedDictionary/Editor/Scripts/SerializedDictionaryInstanceDrawer.cs:277)
TMPEffects.SerializedCollections.Editor.SerializedDictionaryInstanceDrawer.<InitializeSettingsIfNeeded>g__InitializeSettings|49_0 (System.Boolean fieldFlag) (at ./Library/PackageCache/com.luca3317.tmpeffects/Runtime/SerializedDictionary/Editor/Scripts/SerializedDictionaryInstanceDrawer.cs:170)

(etc)

The issue is in the line return getDrawerMethod.Invoke(type, new object[] { type }) != null; in SCEditorUtility.cs. For me, this is within the #if UNITY_2022_3_OR_NEWER brackets.

I've added a try around this line, returning a false in the catch, and that solves the issue for me.

I have a clean installation of TMPEffects set up from just a few days ago. I use the next upcoming version of Unity, version 2023.3.0b10. I believe this version branch will at some point be part of "Unity 6".

maarten-abbey avatar Sep 09 '24 17:09 maarten-abbey