Contains(string)
Checks whether an asset is registered under the given address.
Read time 1 minuteLast updated 16 days ago
Definition
- Type: Method
- Namespace: Unity.Localization.Providers
- Assembly: UnityEngine.LocalizationRuntimeModule
public bool Contains(string address)
Parameters
The address to test.
Returns
Type | Description |
|---|---|
| bool | |
Remarks
An empty or null returns .
addressfalseTest whether an address is registered before and after adding it.
Examples
using Unity.Localization.Providers;using UnityEngine;namespace Unity.Localization.Samples{ public class ReferencedAssetProviderContainsExample { public void Run() { var provider = new ReferencedAssetProvider(); Debug.Log(provider.Contains("UI/Logo")); // False provider.Add("UI/Logo", new Texture2D(2, 2)); Debug.Log(provider.Contains("UI/Logo")); // True } }}