Interface IMetadata
Interface to indicate a class can be used as Metadata. Metadata is data that can be used to provide additional information about the item it is attached to. Metadata can be attached to a Locale, a LocalizationTable, a table entry or a SharedTableData.
Metadata is serialized using the SerializeReference feature, this means that it must be marked as serializable, can be shared across the same asset and does not inherit from UnityEngine.Object. Metadata does not have to include serialized fields, it can also be empty and used to tag fields as having certain attributes. See also MetadataAttribute
Namespace: UnityEngine.Localization.Metadata
Assembly: Unity.Localization.dll
Syntax
public interface IMetadata
Examples
This example shows how Metadata can be created to attach additional region data to a Locale.
[Serializable]
[Metadata(AllowedTypes = MetadataType.StringTableEntry)]
public class TranslationStatus : IMetadata
{
public enum TranslationState
{
Initial,
Translated,
Reviewed,
Final,
}
public TranslationState translationStatus = TranslationState.Initial;
}
This example shows how Metadata can be created to attach an icon to a Locale.
[Metadata(AllowedTypes = MetadataType.Locale)]
[Serializable]
public class LocaleIcon : IMetadata
{
public Texture icon;
}