Skip to content

InvalidCastException when use auto assign on ScriptableObject #1

Description

@sadegh-askari

Hi Peyman,
I hope you are fine.
I ran to this exception when I want to use auto assign on ScriptableObject to find prefabs that their property name not ends with 'Prefab'
Unity Version: 2022.3.18

InvalidCastException: Specified cast is not valid.
AutoAssigner.Assigners.ComponentAssigner.TryAssign (UnityEditor.SerializedProperty property) (at ./Library/PackageCache/com.mnarimani.autoassigner@d8e29e2451/Editor/Assigners/ComponentAssigner.cs:29)
AutoAssigner.Assigner.AssignObjectProperties (UnityEditor.SerializedObject obj) (at ./Library/PackageCache/com.mnarimani.autoassigner@d8e29e2451/Editor/Assigner.cs:31)
AutoAssigner.AutoAssignerEditor.OnInspectorGUI () (at ./Library/PackageCache/com.mnarimani.autoassigner@d8e29e2451/Editor/AutoAssignerEditor.cs:16)
UnityEditor.UIElements.InspectorElement+<>c__DisplayClass72_0.b__0 () (at <8e887700cd7e4674989da7b046e8eaa6>:0)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions