Making an input field with personal text validation at runtime
Here, we are going to create another kind of customization, different from the previous recipes. In this case, we have an input field that we want to perform checks on, thus not allowing the player (instead of allowing, as in the previous recipes) to do something. Unity already has some of these controls in the Input Field (Script) component, but in this recipe, you will learn how you can create your personal filters. In this example, we will develop a simple filter in order for you to understand the concept of how filters work. For instance, we want the player to insert an identifier, maybe for the score database, and we don't want his name to start with a number — because in many ...
Get Unity UI Cookbook now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.