#Dropdown menu in inspector
1 messages · Page 1 of 1 (latest)
https://docs.unity3d.com/ScriptReference/MonoBehaviour.OnValidate.html
This is the callback for when the Editor changes and validates. You could put your code in there
Yea, after researching for a while I got that, but how can I create the dropdown?
Any variable of an Enum type will show up as a dropdown in the editor
Just like that?
This is exactly what I want
so I guess that was okay
Yep, but I wouldn't name something type, it's too close to the class name Type, in general it's best to avoid naming things like actual classes
aight, changed it to heatType. And now how do I call a function depending on the heatType?
like, how do i get the index of heatType?
You'd just check if it's equal to one of the types
if (heatType == HeatmapType.Path)
Yea, thats exactly what I just did, thanks!