Example #1
0
        public override void OnInspectorGUI()
        {
            Undo.RecordObject(_exposedConfiguration, "Exposed Configuration Change");

            string propertyForDeletion = null;

            foreach (KeyValuePair <string, ExposedPropertyConfiguration> keyValuePair in _exposedConfiguration.ScriptConfigurationManager.Properties)
            {
                EditorGUILayout.BeginHorizontal();
                if (GUILayout.Button("Delete", EditorStyles.miniButton, GUILayout.Width(45)))
                {
                    propertyForDeletion = keyValuePair.Key;
                    break;
                }
                _configFieldRenderer.RenderConfigField(null, keyValuePair.Value, keyValuePair.Key);
            }
            if (propertyForDeletion != null)
            {
                _exposedConfiguration.ScriptConfigurationManager.RemovePropertyConfiguration(propertyForDeletion);
            }

            if (GUI.changed)
            {
                EditorUtility.SetDirty(_exposedConfiguration);
            }
        }
Example #2
0
        private void RenderFieldForType(FieldInfo field, Component affectedComponent, ExposedConfiguration configuration)
        {
            string fieldId = field.Name;
            ExposedPropertyConfiguration propertyConfiguration = configuration.ScriptConfigurationManager.GetPropertyConfiguration(fieldId);

            EditorGUILayout.BeginHorizontal();
            RenderFieldReferencesInformation(field, affectedComponent);
            string typeName = _arrayTypeUtils.GetFormatedType(field.FieldType);

            _configFieldRenderer.RenderConfigField(affectedComponent, propertyConfiguration, fieldId, typeName);
        }