Skip to content

In Unity6, the import of Unitypacket is abnormal #114

@Container-Zero

Description

@Container-Zero

Under Unity 6000.0.44f1:

When importing Alchemy via the Package Manager, everything works as expected.

However, when importing the .unitypackage provided in the releases section:
https://github.com/annulusgames/Alchemy/releases/download/v2.0.1/Alchemy.2.0.1.unitypackage

Alchemy does not function properly.

Steps to reproduce:

  1. Import .unitypackage
  2. Create a brand-new project and scene, and attach the following script:
using Alchemy.Inspector;
using UnityEngine;

public class NewMonoBehaviourScript : MonoBehaviour
{
    [Button]
    public void Foo()
    {
        Debug.Log("Foo");
    }
}
  1. Attach the above script to an empty GameObject in the scene.
  2. The component does not display any content in the Inspector.
  3. The console outputs the following error:
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 <314938d17f3848e8ac683e11b27f62ee>:0)
System.Reflection.RuntimeMethodInfo.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <314938d17f3848e8ac683e11b27f62ee>:0)
System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at <314938d17f3848e8ac683e11b27f62ee>:0)
Alchemy.Editor.InternalAPIHelper.GetDrawerTypeForType (System.Type classType) (at Assets/Alchemy/Editor/Internal/InternalAPIHelper.cs:29)
Alchemy.Editor.InspectorHelper.BuildElements (UnityEditor.SerializedObject serializedObject, UnityEngine.UIElements.VisualElement rootElement, System.Object target, System.Func`2[T,TResult] findPropertyFunc, System.Int32 depth) (at Assets/Alchemy/Editor/Internal/InspectorHelper.cs:126)
Alchemy.Editor.AlchemyEditor.CreateInspectorGUI () (at Assets/Alchemy/Editor/AlchemyEditor.cs:95)
UnityEditor.UIElements.InspectorElement.CreateInspectorElementUsingUIToolkit (UnityEditor.Editor targetEditor) (at <0a4d86c6e1e443e4b37da89bc22f5b9c>:0)
UnityEditor.UIElements.InspectorElement.CreateInspectorElementFromSerializedObject (UnityEditor.SerializedObject bindObject) (at <0a4d86c6e1e443e4b37da89bc22f5b9c>:0)
UnityEditor.UIElements.InspectorElement.HandleEventBubbleUp (UnityEngine.UIElements.EventBase evt) (at <0a4d86c6e1e443e4b37da89bc22f5b9c>:0)
UnityEngine.UIElements.EventDispatchUtilities.HandleEventAtTargetAndDefaultPhase (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.BaseVisualElementPanel panel, UnityEngine.UIElements.VisualElement target) (at <2a8180b936c64e29a54e01cee3b47cdd>:0)
UnityEditor.UIElements.Bindings.SerializedObjectBindingContext.SendBindingEvent[TEventType] (TEventType evt, UnityEngine.UIElements.VisualElement target) (at <cc7cc4a922da49f5bd778cb5d289d2f9>:0)
UnityEditor.UIElements.Bindings.SerializedObjectBindingContext.BindTree (UnityEngine.UIElements.VisualElement element, UnityEditor.SerializedProperty parentProperty) (at <cc7cc4a922da49f5bd778cb5d289d2f9>:0)
UnityEditor.UIElements.Bindings.SerializedObjectBindingContext.ContinueBinding (UnityEngine.UIElements.VisualElement element, UnityEditor.SerializedProperty parentProperty) (at <cc7cc4a922da49f5bd778cb5d289d2f9>:0)
UnityEditor.UIElements.Bindings.SerializedObjectBindingContext.Bind (UnityEngine.UIElements.VisualElement element) (at <cc7cc4a922da49f5bd778cb5d289d2f9>:0)
UnityEditor.UIElements.Bindings.DefaultSerializedObjectBindingImplementation.Bind (UnityEngine.UIElements.VisualElement element, UnityEditor.SerializedObject obj) (at <cc7cc4a922da49f5bd778cb5d289d2f9>:0)
UnityEditor.UIElements.BindingExtensions.Bind (UnityEngine.UIElements.VisualElement element, UnityEditor.SerializedObject obj) (at <0a4d86c6e1e443e4b37da89bc22f5b9c>:0)
UnityEditor.UIElements.InspectorElement..ctor (UnityEditor.SerializedObject obj, UnityEditor.Editor editor, UnityEditor.UIElements.InspectorElement+DefaultInspectorFramework defaultInspectorFramework) (at <0a4d86c6e1e443e4b37da89bc22f5b9c>:0)
UnityEditor.UIElements.InspectorElement..ctor (UnityEditor.Editor editor, UnityEditor.UIElements.InspectorElement+DefaultInspectorFramework defaultInspectorFramework) (at <0a4d86c6e1e443e4b37da89bc22f5b9c>:0)
UnityEditor.UIElements.InspectorElement..ctor (UnityEditor.Editor editor) (at <0a4d86c6e1e443e4b37da89bc22f5b9c>:0)
UnityEditor.UIElements.EditorElement.BuildInspectorElement () (at <0a4d86c6e1e443e4b37da89bc22f5b9c>:0)
UnityEditor.UIElements.EditorElement.CreateInspectorElement () (at <0a4d86c6e1e443e4b37da89bc22f5b9c>:0)
UnityEditor.EditorElementUpdater.CreateInspectorElementsForViewport (UnityEngine.UIElements.ScrollView viewport, UnityEngine.UIElements.VisualElement contentContainer) (at <0a4d86c6e1e443e4b37da89bc22f5b9c>:0)
UnityEditor.PropertyEditor.RebuildContentsContainers () (at <0a4d86c6e1e443e4b37da89bc22f5b9c>:0)
UnityEditor.InspectorWindow.RedrawFromNative () (at <0a4d86c6e1e443e4b37da89bc22f5b9c>:0)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions