While often we just wish to display non-interactive text messages to the user, there are times (such as name entry for high scores) where we want the user to be able to enter text or numbers into our game. Unity provides the UI Input Field component for this purpose. In this recipe, we'll create an Input Field that prompts the user to enter their name:
Having interactive text on the screen isn't of much use unless we can retrieve the text entered to use in our game logic, and we may need to know each time the user changes the text content and act accordingly. This recipe adds an event-handler C# script that detects each time the user has completed editing the text, and updates an extra message on screen confirming the newly-entered content.