public override void OnInspectorGUI() { serializedObject.Update(); EditorGUILayout.LabelField("SPRITE EXTENSION"); EditorGUILayout.LabelField("This extension can allow to get a sprite from an image Library"); _enumLibrary = serializedObject.FindProperty("_enumLibrary"); _imageLibrary = serializedObject.FindProperty("_imageLibrary"); _keyType = serializedObject.FindProperty("_keyType"); _enumIndex = serializedObject.FindProperty("_enumIndex"); _enumChoice = serializedObject.FindProperty("_enumChoice"); EditorGUILayout.Space(10); DisplaySpriteData(); // Sprite Data is set if (true == IsConditionsOK()) { EnumLibrary lEnumLibrary = (EnumLibrary)_enumLibrary.objectReferenceValue; ImageLibrary lImageLibrary = (ImageLibrary)_imageLibrary.objectReferenceValue; if (true == lEnumLibrary.IsExist(lImageLibrary)) { EditorGUILayout.BeginHorizontal(); DisplayEnum(); EditorGUILayout.EndHorizontal(); } else { EditorGUILayout.BeginHorizontal(); EditorGUILayout.LabelField("This library is not in the enum library, please verify your data", _warningInfos); EditorGUILayout.EndHorizontal(); } } EditorGUILayout.Space(10); // Apply modifications serializedObject.ApplyModifiedProperties(); }