InsertProvider(int, IAssetProvider)
Inserts a provider at the given position in the chain.
Read time 1 minuteLast updated 12 days ago
Definition
- Type: Method
- Namespace: Unity.Localization.Providers
- Assembly: UnityEngine.LocalizationRuntimeModule
public void InsertProvider(int index, IAssetProvider provider)
Parameters
Remarks
A provider is ignored. Inserting at index 0 makes the provider the first one tried, which lets it take priority over the existing entries.
nullInsert 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 } }}