Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


Contains(string)

Checks whether an asset is registered under the given address.
Read time 1 minuteLast updated 16 days ago

Definition

public bool Contains(string address)

Parameters

address

The address to test.

Returns

Type

Description

bool
true
if an asset is registered under the address; otherwise,
false
.

Remarks

An empty or null
address
returns
false
.
Test 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 } }}