기술 자료

Unity Engine

Unity Engine

GetMetadata<T>()

Returns the first metadata item of the given type.
읽는 시간 1분최근 업데이트: 한 달 전

Definition

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

Returns

Type

Description

TThe first item assignable to
T
, or null when none is present.

Remarks

Use MetadataCollection.GetMetadatas when a target can hold more than one item of the same type.
Read the first comment attached to a collection.

Examples

using Unity.Localization;namespace Unity.Localization.Samples{ public class MetadataCollectionGetMetadataExample { public string Run(MetadataCollection metadata) { var comment = metadata.GetMetadata<Comment>(); return comment?.CommentText; } }}