기술 자료

Unity Engine

Unity Engine

Contains<T>()

Checks whether a metadata item of the given type is present.
읽는 시간 1분최근 업데이트: 한 달 전

Definition

  • Type: Method
  • Namespace: Unity.Localization
  • Assembly: UnityEngine.LocalizationRuntimeModule
public bool Contains<T>() where T : class, IMetadata

Returns

Type

Description

bool
true
if at least one item is assignable to
T
; otherwise,
false
.

Remarks

Equivalent to testing whether MetadataCollection.GetMetadata returns a non-null value.
Check whether a collection already has a comment.

Examples

using Unity.Localization;namespace Unity.Localization.Samples{ public class MetadataCollectionContainsExample { public bool Run(MetadataCollection metadata) => metadata.Contains<Comment>(); }}