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

AssetProvider.RemoveProvider

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 bool RemoveProvider(IAssetProvider provider);

Parameters

Parameter Description
provider The provider to remove.

Returns

bool true if the provider was present and removed; otherwise, false.

Description

Removes a provider from the chain.

When the removed provider was the AssetProvider.Selected one, the selection moves to the first remaining provider, or null when the chain becomes empty.

<para>Remove a provider and confirm it is gone.</para>

using Unity.Localization.Providers;
using UnityEngine;

namespace Unity.Localization.Samples { public class AssetProviderRemoveProviderExample { public void Run() { var chain = new AssetProvider(); var resources = new ResourceFolderProvider(); chain.AddProvider(resources);

Debug.Log(chain.RemoveProvider(resources)); // True Debug.Log(chain.GetProvider<ResourceFolderProvider>() == null); // True } } }