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?