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 LocalizedTable, 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
Syntax
public interface IMetadata
Examples
This example shows how Metadata can be created to attach additional region data to a Locale.
[Metadata(AllowedTypes = MetadataType.Locale)] // Hint to the editor to only show this type for a Locale
[Serializable]
public class RegionInfo : IMetadata
{
public int population;
public string capitalCity;
public string description;
}
This example shows how Metadata can be created to attach an icon to a Locale.
[Metadata(AllowedTypes = MetadataType.Locale)] // Hint to the editor to only show this type for a Locale
[Serializable]
public class LocaleIcon : IMetadata
{
public Texture icon;
}