Version: Unity 6.7 Alpha (6000.7)
LanguageEnglish
  • C#

AssetProvider.InsertProvider

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Declaration

public void InsertProvider(int index, IAssetProvider provider);

Parameters

Parameter Description
index The position to insert at.
provider The provider to insert.

Description

Inserts a provider at the given position in the chain.

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.

<para>Insert a provider at the front so it is tried first.</para>

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