[SOLVED]Dropdown list in inspector

Updated on July 31, 2018 in [A] Unity Scripting
Share on Facebook0Tweet about this on TwitterShare on Google+0Share on Reddit0
5 on June 6, 2016

I know that this is my 3rd post of the day.

How do i make this dropdown thing like a list in the inspector?

  • Liked by
Reply
1 on June 6, 2016

https://polygoned.wordpress.com/2012/05/23/unity3d-creating-a-drop-down-menu-in-a-custom-inspector/ this might help I mean it’s pretty old but I think it’ll take you in the right direction

Helpful
on June 6, 2016

What i meant by a dropdown,i meant like in the picture(something like the script “Spongy” in the pic)

Show more replies
  • Liked by
Reply
Cancel
2 on June 7, 2016

I believe “My Style” is a serialized class and “Font style” is and enum.

Create a C#-script, then inside it try this.

[Serializable]
public class SomeClass
{
public string name;
}
public SomeClass someClass;

Helpful
on June 8, 2016

its says solved but yea, thats how i did it too. I forgot about that you can do that but thx anyways

on July 31, 2018

I tried using this to help organize a long list of variables, but once I do this to the variables the rest of the script can no longer access the variables. Specifically void update cant. I’m guessing it has something to do with the class, but I’m not sure…

 

[System.Serializable]
public class total_stats
{
public int player_hp;
public float crit_chance;
}
public total_stats Total_stats;

Show more replies
  • Liked by
Reply
Cancel