/// <summary> /// Description : Displau Image Models /// </summary> private void DisplayImageModels() { // Image MODEL EditorGUILayout.LabelField("IMAGE MODEL", EditorStyles.boldLabel); _listCount = _imageModels.arraySize; for (int i = 0; i < _listCount; i++) { SerializedProperty lImageModel = _imageModels.GetArrayElementAtIndex(i); SerializedProperty lImageLibrary = lImageModel.FindPropertyRelative("_imageLibrary"); SerializedProperty lEnumIndex = lImageModel.FindPropertyRelative("_index"); lImageModel.isExpanded = EditorGUILayout.Foldout(lImageModel.isExpanded, new GUIContent("Image Model " + i)); if (lImageModel.isExpanded) { EditorGUILayout.BeginHorizontal(); lImageLibrary.objectReferenceValue = (ImageLibrary)EditorGUILayout.ObjectField(lImageLibrary.objectReferenceValue, typeof(ImageLibrary), false); EditorGUILayout.EndHorizontal(); if (lImageLibrary.objectReferenceValue != null) { ImageLibrary lImage = (ImageLibrary)lImageLibrary.objectReferenceValue; if (lImage.GetActualKeyType() == 1) { EditorGUILayout.BeginHorizontal(); EditorGUILayout.LabelField("Enum Path"); string[] lEnumList = _manager.GetAllEnums().ToArray(); lEnumIndex.intValue = EditorGUILayout.Popup(lEnumIndex.intValue, lEnumList); string lEnumName = _manager.GetEnumName(lEnumIndex.intValue); _manager.GetImageModels()[i].SetEnum(lEnumName); EditorGUILayout.EndHorizontal(); if (false == lImage.IsEnumEqual(_manager.GetEnumType(lEnumName))) { EditorGUILayout.BeginHorizontal(); EditorGUILayout.LabelField("THE ENUM IS NOT THE RIGHT ONE, Are you sure to use this one ?", _warningInfos); EditorGUILayout.EndHorizontal(); } } } EditorGUILayout.BeginHorizontal(); if (GUILayout.Button("Delete")) { if (EditorUtility.DisplayDialog("Warning", "Are you sure to delete this enum?", "Yes", "No")) { lImageModel.isExpanded = false; _imageModels.DeleteArrayElementAtIndex(i); break; } } EditorGUILayout.EndHorizontal(); EditorGUILayout.Space(5); } } }