public enum

hi im still really confused on how i get a specific selection, sorry to be a pain but i learn as i work, here is my sample code, is there also a way to make a sub menu bit like the component menu and how would this be done if easier

#pragma strict
    @script ExecuteInEditMode()

public enum menuListA
{aa = 0,ab = 1,ac = 2,}
public enum menuListB
{ad = 3,ae = 4,af = 5,ag = 6,ah = 7,}

var menuA : menuListA;
var menuB : menuListB;

function Update(){

	if(menuA == menuListA.aa){
		
			Debug.Log("menuB = 5 to 7"); // this is the bit im really stuck on getting menu b to only a few options
	}

}

The only way to do this is by using a custom Editor subclass for your entire object. You are then free to present the UI any way you like. The simplest would be just to use DrawDefaultInspector, then add an error message if the settings violate whatever rules you want to enforce (eg. not AddComponent and Gameobject).

BTW, it seems you’re using the first enum item purely to get text in the menu. It is probably cleaner to just have a “None” option, and ensure that the name of the variable is meaningful:

enum Action { None, AddComponent, Destroy }
enum Target { None, Rigidbody, Gameobject }

var action : Action;
var performActionOn : Target;