Declares where a metadata kind may be attached and how it appears in the editor's "Add Metadata" menu.
Apply this attribute to an IMetadata implementation. MetadataAttribute.AllowedTypes limits the targets the
editor offers the metadata on, MetadataAttribute.MenuItem sets the menu label, and MetadataAttribute.AllowMultiple controls
whether more than one item of the kind can be added to the same target.
Additional resources: MetadataType, IMetadata, Comment
<para>Restrict a custom metadata kind to shared table entries and give it a menu label.</para>
using System; using Unity.Localization;
namespace Unity.Localization.Samples { [Metadata(AllowedTypes = MetadataType.SharedTableEntry, MenuItem = "Translator Note", AllowMultiple = false)] [Serializable] public class MetadataAttributeExample : IMetadata { public string note; } }
| Property | Description |
|---|---|
| AllowedTypes | Where this metadata may be attached. |
| AllowMultiple | Whether more than one of this metadata kind may be added to the same target. |
| MenuItem | The menu path shown in the "Add Metadata" menu. |