# InsertProvider(int, IAssetProvider)

> Inserts a provider at the given position in the chain.

## Definition

* **Type:** Method
* **Namespace:** [Unity.Localization.Providers](/engine/6000.7/script-reference/unity/localization/providers.md)
* **Assembly:** UnityEngine.LocalizationRuntimeModule

```csharp
public void InsertProvider(int index, IAssetProvider provider)
```

### Parameters

**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The position to insert at.**** (\[IAssetProvider]\(/engine/6000.7/script-reference/unity/localization/providers/iassetprovider)): The provider to insert.

### Remarks

A `null` provider is ignored. Inserting at index 0 makes the provider the first one tried, which lets it take priority over the existing entries.

Insert a provider at the front so it is tried first.

### Examples

```csharp
using Unity.Localization.Providers;
using UnityEngine;

namespace Unity.Localization.Samples
{
    public class AssetProviderInsertProviderExample
    {
        public void Run()
        {
            var chain = new AssetProvider();
            chain.AddProvider(new ResourceFolderProvider());
            chain.InsertProvider(0, new ReferencedAssetProvider());   // tried first

            Debug.Log(chain.Providers[0] is ReferencedAssetProvider);   // True
        }
    }
}
```
