OptionPanel Prefab

Create OptionPanel Prefab: UI-Panel,2 UI-Buttons

  • Add UI-Panel to your scene

  • Name it: OptionPanel

  • Configure the Canvas to use Screen-Space Camera

  • Resize and use Rect-Transform presets to configure the panel

  • Add CanvasGroup to the OptionPanel (Components > Layout > CanvasGroup )

  • Add 2 Child GameObjects: UI-Buttons: ButtonOption1, ButtonOption2

  • Use Rect-Transform presets to align the child Buttons within the OptionPanel

  • Optional: Use Images for you Button (see below)

  • Optional: Add Horizontal Layout Component to the OptionPanel (See below)

  • Make a prefab from the OptionPanel GameObject

  • You can use this prefab to add scene-transition buttons to each scene.

Horizontal Layout Component

Optional: To create a Panel with Auto-layout to include padding, you can add a Horizontal Layout Component to the OptionPanel. Set the Padding and Alignment to your preferences.

Sprites For Panel and Buttons

The images below show how to use Images for Buttons. See the gitbook section on using Sprite Sheets

Select Sprite Swap as the Button Transition setting. Then select the highlighted version of the button image for the Highlight Sprite.

Preserve Aspect ratio was used in this example.

Finally: Remember to Make a Prefab of the OptionPanel

Last updated