Beispiel #1
0
        public override void OnGUI(Rect r, SerializedProperty property, GUIContent label)
        {
            var index = property.FindPropertyRelative("id");

            int newindex = EditorGUI.Popup(r, label.text, index.intValue, MountSettings.ToArray());

            if (newindex != index.intValue)
            {
                Undo.RecordObject(property.serializedObject.targetObject, "Change Mount Selection");
                index.intValue = newindex;
                property.serializedObject.ApplyModifiedProperties();
            }
        }
 protected override string[] GetStringNames(SerializedProperty property)
 {
     return(MountSettings.ToArray());
 }