Edit OptionPanel

This page provides configuration details for UI Panel GameObjects: OptionPanel, TitlePanel, used with Dialog Prefabs.

For any UI-Panel that you'd like to show/hide, you must add a CanvasGroup, and the Hide_Show_Panel.cs script as shown in the image below.

The Hide_Show_Panel.cs script component's public fields: ShowOnStart, CloseButton, OpenButton will be configured according to desired behavior for each situation. The examples below show a few possible configurations.

Hide_Show_Panel, CanvasGroup

OptionPanel - Prefab

Link to Detailed Instructions to create OptionPanel OptionPanel prefab is a UI panel that contains 2 buttons that can be used for scene change logic in all scenes. Now that we're adding dialog to the scenes, the OptionPanel can initially be hidden when the scene is loaded. Then it's opened by the OptionPanel's script, when there's no dialog left to display. It is configured as the "NextPanelToOpen" for the SimpleDialog and DialogManager scripts.

OptionPanel:This is a UI-Panel with 2 child-objects that are UI-Buttons.

Edit OptionPanel

Open OptionPanel Prefab to Edit: Attach CanvasGroup Attach Hide_Show_Panel.cs

  • Configuration for Hide_Show_Panel.cs on OptionPanel:

    • ShowOnStart - default: hidden, determines if the dialog is visible at start of scene

    • CloseButton: (not populated)

    • OpenButton: (not populated)

The image below shows the hierarchy panel for a TitlePanel that has a UI text, and a UI-Button that can be used to open a dialog prefab.

It is optional to use a TitlePanel, but it provides a simple way to provide game instructions in

TitlePanel - Prefab (Optional)

TitlePanel: This is a UI-Panel with children:

  • Children:

  • UI-Text: TitleText

  • UI_Button: StartDialogBtn

  • Attach CanavasGroup

  • Attach Hide_Show_Panel.cs The Hide_Show_Panel script will make sure the panel shows at start, and is hidden when the StartDialogBtn is clicked.

  • Configuration for Hide_Show_Panel.cs on TitlePanel:

  • ShowOnStart checked as True

  • CloseButton: StartDialogBtn

  • OpenButton: empty

Last updated