public override bool CanCacheInspectorGUI(SerializedProperty property) { if (property.type == "int") { intPopup = attribute as IntPopupAttribute; return(true); } else { return(false); } }
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) { IntPopupAttribute pa = this.attribute as IntPopupAttribute; if (property.depth <= 0) { position.xMin += 4; } int v = property.intValue; v = EditorGUI.IntPopup(position, pa.Lable, v, pa.DisplayedOptions, pa.OptionValues); if (GUI.changed) { property.intValue = v; } }