Enum Dropdown in JS Using Custom Editor?

I’ve been practicing with the Unity Custom Editor and using both C# and JS. I’m doing a simple editor script that uses an enum to have a dropdown menu to change the value of an int. I got it to work in C# but not JS. Is there something I’m doing wrong? Here’s what I have, any help would be appreciated.

In JS:

I get 3 of these errors:

‘;’ expected. Insert a semicolon at the end

class EditorTest extends Editor {

	 enum ValueDropDown {Value1 = 1, Value2 = 2, Value3 = 3, Value4 = 4};
	
	 var ValueDropDown : editorChangeValue = ValueDropDown.Value1;

    function OnInspectorGUI () {
		
		editorChangeValue = (ValueDropDown)target.valueToChange;
		editorChangeValue = (ValueDropDown)EditorGUILayout.EnumPopup("Change Value:", editorChangeValue);
    	target.valueToChange = (int)editorChangeValue;
     }
}

take away the ; on

enum StartTimeDropDown {Value1 = 1, Value2 = 2, Value3 = 3, Value4 = 4};

So it should be:

enum StartTimeDropDown {Value1 = 1, Value2 = 2, Value3 = 3, Value4 = 4}

See what errors that might leave.

I ended up figuring it out.

The syntax is different than C# so I tried a few things and got it working great. I searched for about a day straight looking for a solution but found none. So if you’re like me looking for an answer, here it is. I hope it helps whoever is looking for the same thing.

In JS, this allows you to edit an int from another script using a fancy enum pulldown menu in the Inspector using the Custom Editor in Unity.

class EditorTest extends Editor {
 
     enum ValueDropDown {Value1 = 1, Value2 = 2, Value3 = 3, Value4 = 4};
 
     var ValueDropDownEditor = ValueDropDown.Value1;
 
    function OnInspectorGUI () {
 
       ValueDropDownEditor = target.valueToChange;
		ValueDropDownEditor = EditorGUILayout.EnumPopup("Change Number:", ValueDropDownEditor);
    	target.valueToChange = ValueDropDownEditor;

     }
}