# GetSharedMaterials(List<Material>)

> Returns all the shared materials of this object.

## Definition

* **Type:** Method
* **Namespace:** [UnityEngine](/engine/6000.7/script-reference/unityengine.md)
* **Assembly:** UnityEngine.CoreModule

```csharp
public void GetSharedMaterials(List<Material> m)
```

### Parameters

**** (\[List\<Material>]\(https\://learn.microsoft.com/dotnet/api/system.collections.generic.list-1)): A list of materials to populate.

### Remarks

Use this method instead of [Renderer.sharedMaterials](/engine/6000.7/script-reference/unityengine/renderer/sharedmaterials.md) if you control the life cycle of the list passed in and you want to avoid allocating a new array with every access.
