Contains<T>()
Checks whether a metadata item of the given type is present.
阅读时间1 分钟最后更新于 1 个月前
Definition
- Type: Method
- Namespace: Unity.Localization
- Assembly: UnityEngine.LocalizationRuntimeModule
public bool Contains<T>() where T : class, IMetadata
Returns
Type | Description |
|---|---|
| bool | |
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>(); }}