Showing variables in inspector if other variables are populated

I really have two questions. So when using Dastardly Banana’s gunscript in my own projects I really like how they set up enum variables to switch from gun, to launcher, to a laser. With doing that they also had it where certain variables would show up, if say the launcher was selected, and projectile variable would show up in the inspector for what is being shot, but when it was set to gun that variable hid. I am trying to achieve this and with looking through there script I see no way of how it is happening. Does anyone have any insight on how this is working. So I can set this up on scripts I am making now for vehicles, depending on the type of vehicle, Semi Truck, Pickup, Car, Go-cart, tractor, they have different stuff I am gonna have to input.

Second question is, how do I have it so if an array is populated, say I make one array size 4, then I want to be able to have 4 seperate variables pop up with the name of each element as the variable. example, I have an array for how many gears a vehicle has. when I set size to 4, and name elements with 1,2,3,4, that below them, it pops up

Gear 1 Speed
Gear 2 Speed
Gear 3 Speed
Gear 4 Speed

For a person to then enter what speed they want each gear to shift at and such. But then hide if no gears present.

This is all occurring for setting up vehicles and from what I know can’t be put in a start function of course. Any answers of all you fantastic people will be mighty helpful.

Thanks,

Tainted

I don’t know Dastardly Banana’s gun script but it sounds like there’s a custom inspector script at work.

Maybe this can help?
http://forum.unity3d.com/threads/83054-Inspector-Enum-dropdown-box-hide-show-variables