# OnApplyRevertGUI()

> Process the 'Apply' and 'Revert' buttons.

## Definition

* **Type:** Method
* **Namespace:** [UnityEditor.AssetImporters](/engine/6000.6/script-reference/unityeditor/assetimporters.md)
* **Assembly:** UnityEditor.CoreModule

```csharp
protected virtual bool OnApplyRevertGUI()
```

### Returns

| Type                                                          | Description                                                 |
| ------------------------------------------------------------- | ----------------------------------------------------------- |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | Returns true if the new settings were successfully applied. |

### Remarks

This is called by ApplyRevertGUI to place and handle the 'Apply' and 'Revert' buttons.

### Examples

```csharp
using UnityEngine;
using UnityEditor;
using UnityEditor.AssetImporters;

public class ExampleScript : ScriptedImporterEditor
{
    public override void OnInspectorGUI()
    {
        serializedObject.Update();

        // Draw custom GUI

        serializedObject.ApplyModifiedProperties();
        ApplyRevertGUI();
    }

    private bool CanApply()
    {
        // Add custom checks that make sure the Importer is in a valid state to be applied.
        return false;
    }

    protected virtual bool OnApplyRevertGUI()
    {
        using (new EditorGUI.DisabledScope(!HasModified()))
        {
            RevertButton();
            using (new EditorGUI.DisabledScope(!CanApply()))
            {
                return ApplyButton();
            }
        }
    }
}
```
