# OnClosed(Material)

> This method is called when the ShaderGUI is being closed.

## Definition

* **Type:** Method
* **Namespace:** [UnityEditor](/engine/6000.0/script-reference/unityeditor.md)
* **Assembly:** UnityEditor

```csharp
public virtual void OnClosed(Material material)
```

### Parameters

**** (\[Material]\(/engine/6000.0/script-reference/unityengine/material)):&#x20;

### Remarks

A common reason for this is when a new shader is assigned to a material. The callback is called immediately before the new shader is assigned.
