Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Any good tutorial for dropdown component in Unity5?

Discussion in 'UGUI & TextMesh Pro' started by rapidrunner, Mar 7, 2016.

  1. rapidrunner

    rapidrunner

    Joined:
    Jun 11, 2008
    Posts:
    944
    I am learning this component, although the API show just the properties, methods and events,while the manual give a brief overview about how to use it.

    I have an enum; and I am trying to add that enum to the dropdown component.
    I tried to pass it to the AddOptions method, which obviously won't work, since it accept strings.

    Also from my understanding, when you select something from the dropdown, the "On Value Changed" fire up, sending the integer related to the choosen entry. And this is the only way to actually use the control, once you have all the options set.

    Is there any brief tutorial that show how to use the dropdown component via code? Mst of the video that I found, were too basic; while others were not even using the Unity controller, but where creating their own version.
     
    tinnath likes this.
  2. tinnath

    tinnath

    Joined:
    Jul 13, 2016
    Posts:
    2
    I'm trying to do something similar, did you figure this out or find a good tutorial?
     
  3. rapidrunner

    rapidrunner

    Joined:
    Jun 11, 2008
    Posts:
    944
    Hi, I did figure it out; sadly for some things, there is no help. You have to figure things out on your own, and for some reason, keep it safe :)

    Try it yourself, if you still can't get to the bottom, I can try to help. What are you planning to do ?
     
  4. tinnath

    tinnath

    Joined:
    Jul 13, 2016
    Posts:
    2
    Hi, thanks for replying,
    I figured it out :)
    I only needed to save the input as enum, so it wasn't that complicated. -just needed to understand how the dropdowns work, and the UI system, actually. I'm new to all of this :D

    Also, using the description attribute came in handy
     
    Last edited: Jul 15, 2016
  5. rapidrunner

    rapidrunner

    Joined:
    Jun 11, 2008
    Posts:
    944
    Glad that you figured it out; keep it up and don't get down if things get rough... it is like this with every single API, so you get used to be abused by questionable docs and overall lack of clarity in the few examples made available ;)