Unity Design Flow: Button Magic

Hal Brooks
3 min readJan 9, 2022

Object: Use Button On Click() to navigate the Insurance App.

Insurance app workflow implemented by enabling and disabling of panels based on button events.

Unity has a wonderful way to control the flow of an app using the Button component’s On Click () events. Looking at the hierarchy window, below, the app has eight panels which are used to collect and look at claim information.

Hierarchy for the App

The app design flow is shown below and has two work streams depending which button is selected from the Main_Menu_Panel. Both streams converge on the Overview which returns the user to the Main Menu. The Border_Panel is an overlay for all panels, excepting the Main Menu.

Design Flow for Insurance App

The initial screen for the app is the Main_Menu_Panel. This has two buttons which control the app. Select the Find_Case_Button in the hierarchy window and use the On Click() event to add the Search_Panel and Border_Panel and set both game objects to active. This overlays the Border_Panel on top of the Search_Panel, because Border_Panel is at the bottom of the hierarchy. Inactivate any unused panels to avoid raycast issues, in this case set Main_Menu_Panel to be inactive, as shown below.

Find_Case_Button’s On Click() events.

The Search_Panel has the Search_Button which is used to activate the Select_Panel and inactive itself. The Border_Panel remains active until it is no longer used.

Search_Button’s On Click() events.

The Select_Panel has an Accept_Button which is used to activate the Overview_Container and inactive itself.

Accept_Button’s On Click() events.

The Overview_Container allows the user to scroll through the claim information and has a Back_Button which is used to reactivate the Main_Menu_Panel and inactive itself and the Border_Panel, which is not used for the Main_Menu_Panel.

Back_Button’s On Click() events.

The Main_Menu_Panel also has a create a case button, labeled “File New Claim”. Select the Create_Case_Button and use the On Click() event to add the Create_Claim_Panel and Border_Panel and set both game objects to active. Inactivate the Main_Menu_Panel, as shown below.

Create_Case_Button’s On Click() events.

The Create_Claim_Panel has a Next_Button which is used to activate the Select_Panel and deactivate itself.

Next Button’s On Click events for Create Claim

The Create_Location_Panel also has a Next_Button which is used to activate the Take_Photo_Panel and deactivate itself.

Next Button’s On Click events for Create Location

The Take_Photo__Panel has yet another Next_Button which is used to activate the Overview_Container and deactivate itself.

Next Button’s On Click events for Take Photo

The Overview_Container was discussed earlier and contains a Back_Button that returns to the Main_Menu_Panel. Unity’s button system allows easy implementation of design flow for the app’s user interface (UI).

--

--