Search Issue Tracker

Fixed

Fixed in 2020.3.42f1, 2021.3.13f1, 2022.1.19f1, 2022.2.0b9, 2023.1.0a6

Votes

0

Found in

2020.3.36f1

2021.3.0f1

2023.1.0a2

Issue ID

UUM-7896

Regression

No

ArgumentException thrown when calling ObjectFactory.CreateInstance with a custom class inheriting from UnityEngine.Object

--

-

Reproduction steps:
1. Open the attached project "1425698.zip"
2. Click "ObjectFactoryExample/Create Material Asset" in the Menu bar

Expected result: No errors are logged in the Console window
Actual result: An error is logged:
ArgumentException: 'type' parameter is abstract and can't be used in the ObjectFactory : EntitySaveTemplate
UnityEditor.ObjectFactory.CreateInstance (System.Type type) (at /Users/bokken/buildslave/unity/build/Editor/Mono/ObjectFactory.bindings.cs:67)
UnityEditor.ObjectFactory.CreateInstance\[T] () (at /Users/bokken/buildslave/unity/build/Editor/Mono/ObjectFactory.bindings.cs:49)
SaveSystem.Editor.CreateInstanceExample.CreateMaterialEditor () (at Assets/CreateInstanceExample.cs:11)

Reproducible with: 2020.3.36f1, 2021.3.6f1, 2022.1.8f1, 2022.2.0a19, 2023.1.0a2

Reproducible on: macOS 12.4 (Intel)

  1. Resolution Note (fix version 2023.1.0a6):

    Fixed in: 2023.1.0a6

  2. Resolution Note (fix version 2022.1.19f1):

    Fixed in: 2022.1.19f1

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.