Drop down menu for inspector without using enums

Is it possible to create a drop down menu for the inspector without using enums?

For example, during editing, I want to find all game objects with the same tag and list them in the inspector using a drop down menu. The number of these game objects vary so I can’t use an enum to represent the drop menu contents.

You could do it with a custom editor:

Here’s a sample script to get you started.

Save the first one as showDropDown.js:

var objectNames = Array("enemy1", "enemy2", "enemy3");
var index = 0;

Save this one as showDropDownEditor.js, in a folder named Editor:

@CustomEditor (showDropDown)
class showDropDownEditor extends Editor{
	function OnInspectorGUI(){
		target.index = EditorGUILayout.Popup("Game Objects", target.index, target.objectNames);
	}
}

Thanks for the suggestion. That really helped me get started.

Just wondering, is it possible to create a list of GameObjects instead of strings?

Yes, you can use FindGameObjectsWithTag.