Search Unity

Discussion List in editor inspector dropdown

Discussion in 'Scripting' started by baba_06, Apr 29, 2023.

  1. baba_06

    baba_06

    Joined:
    Dec 10, 2022
    Posts:
    5
    Hello, I'm trying to find a way to create in an inspector script, a drop-down, which will contain the elements of a list in the editor, but I'm having a little trouble finding how to do it :/
     
  2. orionsyndrome

    orionsyndrome

    Joined:
    May 4, 2014
    Posts:
    3,108
    Check out this thread. It includes a tutorial/code on custom inspector drawer for drop-down behavior, among other things. It's a bit advanced, but the custom drawer, the part you're interested in, is as simple as it can be. (It's under QuasiEnumDrawer button.) If you're still unsure about any of it, just ask, and I can walk you through it.

    Edit:
    You can also download the latest version of the entire source code in this post, for further inspection.
     
    baba_06 likes this.
  3. baba_06

    baba_06

    Joined:
    Dec 10, 2022
    Posts:
    5
    Thank you that's great, I just have a little headache now xD