Search Issue Tracker

By Design

Votes

0

Found in

5.5.0x1

Issue ID

862735

Regression

No

Headers does not show up if there is no public variable after it

Scripting

-

Reproduction steps:
1. Open project attached (Header Problem.zip).
2. Open scene "Test";
3. Press on "Main Camera"
4. Look at Example Class (Script) variables.

Expected result: over script variable Health and Shield will be headers.
Actual result: There are no headers over Health and Shield.

Reproduced o: 5.3.7p2, 5.4.3p4, 5.5.0p2 5.6.0b2.

Note: Open ExampleClass.cs to check the cause.
Header should appear no matter what kind of variable is after it.

Comments (6)

  1. pjbaron

    May 20, 2020 23:31

    This is only "by design" in the sense that it is believed to be justifiable.
    It is very annoying having to reorder parameters in order to get an editor feature to work correctly.

  2. filcomet

    Oct 23, 2019 20:53

    Works if the private variable is using [SerializeField], but not if the first variable is Public.
    Unity 2019.2.8

  3. robertfcrocker

    Sep 17, 2019 18:21

    The eye strain comes from eye muscles in an attempt to have better focus <a href='https://alliedeyecare.com.au/pediatric-eye/'>eye test for children</a>

  4. BigGameCompany

    Feb 08, 2019 02:13

    Same in 2018.3. Seems like a poor design decision to me.

  5. wgamestom

    Oct 25, 2018 19:21

    This is marked "By Design" but it really does feel like a bug.

    I solved my instance of this issue by rearranging the properties relating to that section so that the first one is public, but I feel like the private ones I had there first made slightly more sense in terms of organization.

    Can anyone comment on why this design choice is beneficial?

  6. muzboz

    Feb 06, 2018 08:05

    I noticed just now, using Unity 2017.2, that the Header in the Inspector won't appear unless the variable directly under the header is Public.

    So, as long as the first item under the Header is public, the heading will appear.

    (I would expect the Header to ALWAYS appear, no matter even if there were only Private variables declared below it, or indeed no variables at all.)

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.