기술 자료

Unity Engine

Unity Engine

Contains(string)

Checks whether an asset is registered under the given address.
읽는 시간 1분최근 업데이트: 한 달 전

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