- Home /
Dropdown like menus in the inspector
I don't know the correct word for these, but how do you make them? I use C#. I would be needing them to organisize the inspector a bit or otherwise there would be hundreds of waypoints for different strategies. There are strategies (like plays in american football) to choose from and they all have their own waypoints and stuff set in the inspector (I know it's not the most effigent way to do this, but it works for now) so having a dropdown like that for each strategy would help to keep the inspector clean.
Answer by YourGamesBeOver · Mar 06, 2014 at 11:51 PM
I've been trying to figure this out too. I cracked into CharacterController.js to see how it does it. Based on that and some research, I figured it out!
This code:
public class FoldTest : MonoBehaviour {
public string NotHiddenString;
public int NotHiddenInteger;
public FoldedData HiddenData;
[System.Serializable]
public class FoldedData{
public int HiddenInteger;
public string HiddenString;
}
}
Will produce this in the Inspector:
A related and helpful article: Property Drawer
Answer by perchik · Mar 06, 2014 at 07:15 PM
Yes, this is what I meant. How can I achieve these in a regular script ins$$anonymous$$d of in a separate inspector window?