Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


InsertProvider(int, IAssetProvider)

Inserts a provider at the given position in the chain.
Read time 1 minuteLast updated 12 days ago

Definition

public void InsertProvider(int index, IAssetProvider provider)

Parameters

index

The position to insert at.

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

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 } }}