YarnSpinnerTool / YarnSpinner-Unity

The official Unity integration for Yarn Spinner, the friendly dialogue tool.
MIT License
491 stars 85 forks source link

Cannot create or get Unity Localized Line Metadata #214

Closed samanabo closed 1 year ago

samanabo commented 1 year ago

What is the current behavior? When using Unity Localization package features, the UnityLocalization.LineMetadata is not serialized and is missing the attribute [Metadata(AllowedTypes = MetadataType.SharedStringTableEntry)] preventing the metadata type from being added to entries. Additionally, the UnityLocalisedLineProvider does not pull in Metadata from the yarn script file so there is currently no way to add metadata when using Unity Localization.

Please provide the steps to reproduce, and if possible a minimal demo of the problem: For the Localized Table Metadata issue:

  1. Setup a project with unity localization package, and yarn experimental features on
  2. Create a string table, and add entries to it.
  3. Observe when you click the Edit Table Entry Metadata button the yarn spinner metadata type does not appear as an option

For the Yarn Spinner Metadata issue:

  1. Setup a project with unity localization package, and yarn experimental features on
  2. Write a yarn script that includes a custom tag
  3. Run the game and notice the tag from the yarn script is not present in the localisedLine.Metadata

What is the expected behavior? Users should be able to add this metadata type to 'shared entires'. User should be able to get MetaData from the yarn script.

Please tell us about your environment:

desplesda commented 1 year ago

This is fixed as of the upcoming v2.3 release; Line Metadata is now serialisable, appears in the table editor, and is delivered as part of the LocalizedLine.