With Result Parser you can modify the Content Data after the node is processed but before the UI displays the data. This is helpful when you want to implement features like localization and variable parsing.
Before forwarding the Content Data to the UIManager, the Dialogue Manager runs the data through every parser in the project based on their compute order value.
To create a new result parser, create a new script and implement the IResultParser interface.
publicclassMyResultParser:IResultParser{publicintcomputeOrder=>2;// Higher value later it appliespublicvoidParse(UIContentDatacontent){foreach(stringkeyincontent.Keys){stringval=content.Get<string>(key,string.Empty);if(string.IsNullOrEmpty(value))continue; // Here comes the parsing logic. // modify the val variable as you need.content.Add(key,val,true);}}}
Compute Order is important. The Dialogue Manager applies parsers to the content in ascending order, the higher this value the later it executes.
After creating the new ResultParser the system automatically recognizes it.