[DisableInPrefabAssets] and [HideInPrefabAssets] neither disable nor hide inspector elements when selected in prefab editor window

Issue #603 new
Noah Bannister created an issue

1. What happened?

Fields and methods marked with the DisableInPrefabAssets or HideInPrefabAssets attributes appear normally (neither hidden nor disabled) when a prefab is opened in the prefab editor window.

2. How can we reproduce it?

Create a Monobehavior script with a public field or void method. (If using a method, add the Button attribute.)

Then add either a DisableInPrefabAssets or HideInPrefabAssets attribute.

And this script to a GameObject as a component.

Create a prefab from the GameObject.

Selecting the prefab in the project panel with cause the field or button to be correctly hidden or disabled.

Double c licking the prefab to open the prefab editor will cause the field or button to be shown incorrectly, neither hidden nor disabled.

3. If screenshots would help explain or demonstrate your issue, please include these.

Example method:

When selected in prefab editor:

Works as expected when selected in project panel:

4. What version of Unity are you using?

Reproduced in both 2018.3 and 2018.4

5. What version of Odin are you using? (See "Tools > Odin Inspector > About")

2.1.6

6. Do you have Editor Only mode enabled?

No

7. What operating system are you on?

Windows 10

Comments (0)

  1. Log in to comment