Journal 126 — Unity App Development Setup Part 7 UI Manager and Scripting

Objective: To create the UI Manager and scripting for processing input data for the case number and client info

In the previous articles, I set up the navigation and Interface for processing data between screens. In this article, I will create the UI Manager.

First, we need to create the C# script, and follow the singleton pattern, and place the script on the Canvas game object.

Next, we can add a Case variable, and use this to fill in the active case information, or the search results from AWS. Or we could create an array of cases.

Create a Case

When creating a case, we need a function to generate a new case number. We can add this in the UI Manager. And we can add an On Click event to the main menu screen.

The first step after creating a case is to generate a case number and assign it to the active case.

We can create a random integer and assign it to the caseID. While testing, I found that the On Click events to set the Client Info screen active was not correctly showing the new case ID. So the CreateNewCase script can be used to first generate the new case ID, then set the Client Info screen active. While changing this around, be sure to remove the On Click events from the Main Menu screen for the Create Case button. Over in the ClientInfoPanel script, we can format the case number display.

Client Info Panel Names

The next part of the Client Info Panel is to work with the first and last names. We want to first check if the first or last name is empty. If so, we don’t want to continue. Similar to the previous example, we want to change the control of the buttons and remove the On Click event and have the Client Info script handle the transition to the next screen.

The last thing to update is the active case info.

Thank you for your time!

The next article will go over adding Google Maps to the Location Panel.