EditorGUI Enum help

My gun script is this:

public enum GunType
	{
		singleShot,
		rapidFire,
		burst,
		shotgun,
		launcher
	}

	public GunType gunType;

My Editor script is this:

using UnityEngine;
using System.Collections;
using UnityEditor;

[CustomEditor(typeof(GunScript))]
public class GunEditorScript : Editor 
{
	public override void OnInspectorGUI()
	{
		GunScript myTarget = (GunScript)target;

		myTarget.gunType = (GunType)EditorGUILayout.EnumPopup(myTarget.gunType);
    }
}

Why cant I get this enumpopup to work?

You’re missing something that marks the object as dirty. SetDirty is deprecated for scene objects. You should use Undo.RecordObject.