No highlighting and no NullReferenceException when misspelling searchBox

Just a warning for others, I misspelled searchBox but did not get any errors, even at runtime. Due to this my callback didn’t get registered and so search highlighting didn’t work. Luckily I remembered Gary’s warning about misspelling and figured it out.

1 Like

This highlights the need to be extra careful with spelling when creating your UXML files and your search string. Sometimes, I find it’s helpful to open the UXML file in my code editor and copy/paste the strings between the XML and the code.

Unfortunately, there’s not an easy way to automatically manage the strings between the code and the UXML files. That might make a handy tool for somebody to write, something that looks for names in a UXML file and turns them into string constants that can be used in the C# file.

Privacy & Terms