Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


RemoveProvider(IAssetProvider)

Removes a provider from the chain.
Read time 1 minuteLast updated 10 days ago

Definition

public bool RemoveProvider(IAssetProvider provider)

Parameters

The provider to remove.

Returns

Type

Description

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

Remarks

When the removed provider was the AssetProvider.Selected one, the selection moves to the first remaining provider, or
null
when the chain becomes empty.
Remove a provider and confirm it is gone.

Examples

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