I have a monobehavior set up with a LocalizeStringBehaviour that points to a string reference formatted like Black: {0} / {1}. The string reference has arguments set in code like this:
LocalizedString.StringReference.Arguments = new object[] {
Value0,
Value1
};
On a fresh run of the editor, after hitting play, the string gets resolved like so although subsequent runs the string resolves fine.
I tracked this down to a null names property on a ListFormatter.
Hey,
This sounds familiar. I think its a bug with the SerializeReference feature that came into 2019.3.
Some properties were going null when they really never should. Ill see if I can find out the status of it.
Thanks for reporting the bug!
Got the same error in android il2cpp-backed build.
Looks like other formatters are inherited from FormatterBase class.
Their Names field has explicit SerializeField attribute:
public abstract class FormatterBase : IFormatter
{
[SerializeField]
string[] m_Names;
public string[] Names
{
get => m_Names;
set => m_Names = value;
}
public abstract bool TryEvaluateFormat(IFormattingInfo formattingInfo);
}
And they are initiating list of names in the constructor:
[Serializable]
public class ConditionalFormatter : FormatterBase
{
public ConditionalFormatter()
{
Names = new[] {"conditional", "cond", ""};
}
}
Removing ListFormatter from Smart Format in Project Settings resolved issue.