I have a bunch of ScriptableObjects that hold in-game dialogue data. I write string data into these assets using TextField UIElements. Recently I implemented a system to inject runtime variables into the dialogue by using a simple string.Replace mechanism. So when a designer enters a text like “I have {{goldAmount}} gold pieces” the system converts {{goldAmount}} to the inventory variable representing the player’s gold amount. Which works just fine.
But then I started getting these errors:
Unable to parse file Assets/Resources/Dialogue.asset: [Parser Failure at line 820: Expected closing ‘}’]
It doesn’t seem to interfere with the actual saving and loading of the asset, but it’s making me nervous. Is there a rule for using {{ }} inside a text field? Are they not automatically escaped/sanitized for some reason?