Changing drop down box options depending on another one.

I’m in the middle of making an Editor Script that spawns the object of your choice, and has options to change some variations on the object.

In this picture, for the Door Type I have glass selected, but some options bellow aren’t usable with this type.

The glass door does not have any Upper Varients, so I want to be able to hide the whole Enum, where as in the exterior Handles, only some are available to choose from, so how can I hide the ones you can’t pick. Right now I have a fallback, if the option isn’t available it will go to the next one that is.

I’m using Enum’s to make the dropdown box, if there is a better way please tell.

Thanks

I figured it out, if anyone wants to know. Here is the code.

    [CustomEditor(typeof(DoorSpawner))]
    public class DoorEditor : Editor {


        public enum DoorType { Normal, Glass }

        /// <summary>
        /// Choose which type of door you would like.
        /// </summary>
        public DoorType doorType;
        private DoorType currentType;

         string[] doorSidesNorm = new string[]
        {
            "Right"
        };

         string[] doorSidesGlass = new string[]
       {
            "Right", "Left", "Double"
       };

        public string[] doorSideOptions;
        int doorSideSelected = 0;

public override void OnInspectorGUI()
        {
            //DrawDefaultInspector();
            DrawDoorSideSelector();
        }

        void DrawDoorSideSelector()
        {

            doorType = (DoorType)EditorGUILayout.EnumPopup("Door Type", doorType);

            if (doorType == DoorType.Normal)
            {

                doorSideSelected = EditorGUILayout.Popup("Label", doorSideSelected, doorSidesNorm);

                if (doorSideSelected > doorSidesNorm.Length)
                    doorSideSelected = 0;

            }
            else if (doorType == DoorType.Glass)
            {

                doorSideSelected = EditorGUILayout.Popup("Label", doorSideSelected, doorSidesGlass);

                if (doorSideSelected > doorSidesGlass.Length)
                    doorSideSelected = 0;

            }

        }
}