Search Unity

multiple [Header("example")] attributes order problem

Discussion in 'Scripting' started by NGC6543, Oct 14, 2016.

  1. NGC6543

    NGC6543

    Joined:
    Jun 3, 2015
    Posts:
    228
    Hi, I've noticed a little ackward behaviour in the inspector.
    When multiple Header attributes are used, the order in the inspector is wrong.

    스크린샷 2016-10-14 12.27.38.png

    스크린샷 2016-10-14 12.27.48.png

    any idea what causes this issue?
     
    Vivien_Lynn and ArachnidAnimal like this.
  2. takatok

    takatok

    Joined:
    Aug 18, 2016
    Posts:
    1,496
    The docs show an order variable. Try this code and see if it fixes it:
    Code (CSharp):
    1. [Header("GameManager Effects Settings", order = 0)]
    2. [Header("Slow motion", order = 1)]
    3. [Header("Test",order  =2)]
     
    Vivien_Lynn and ArachnidAnimal like this.
  3. NGC6543

    NGC6543

    Joined:
    Jun 3, 2015
    Posts:
    228
    Wow, that works. that's clumsy but works. Thanks!
     
  4. radiantboy

    radiantboy

    Joined:
    Nov 21, 2012
    Posts:
    1,633
    seems like order no longer works
     
  5. MetalDonut

    MetalDonut

    Joined:
    Feb 7, 2016
    Posts:
    127
    Just dropping this in for anyone that finds it while searching... This does work, but you need to put the order=n in the bracket, not the square bracket:

    CORRECT: [Header("Settings", order=1)]
    INCORRECT: [Header("Settings"), order = 1]

    Also, works with Space etc. so you can properly lay things out. Hope this is helpful!