ellipsis-strokeDock

The Dock is the primary navigation element inside the Main Menu. It contains three dock items, each corresponding to one of the main menu pages:

  • Armory Dock Item

  • Stages Dock Item (Journey)

  • Upgrades Dock Item

circle-info

If you need to modify any existing class in the project, it’s strongly recommended to inherit from the existing class instead of editing the original file directly. This approach makes updating the template to a new version much easier. Original classes are designed for extensibility and make extensive use of protected virtual methods while rarely using private ones.

Dock Overview

Dock Inspector

The Dock Inspector contains the following fields:

  • Dock Items - A list of all dock items.

  • Left Gamepad Indicator - Displayed only when the active input type is set to Gamepad and any item other than the leftmost one is selected.

  • Right Gamepad Indicator - Displayed only when the active input type is set to Gamepad and any item other than the rightmost one is selected.

Dock Behavior Script

The MainMenuDockBehavior script manages the dock’s functionality and interaction logic. It defines two properties, one event, and eight methods.

Properties

Event:

Methods:

Dock Item Overview

Each Dock Item represents one button in the Dock and is linked to a specific Main Menu Page.

Dock Item Behavior inspector.

The Dock Item Inspector has the following fields:

  • Page Type - Enum linking this dock item to a specific main menu page.

  • Button Reference to the Button component. When pressed, it selects this dock item and opens the corresponding page. The onClick event is assigned via code.

  • Page Name Text - Reference to the TMP_Text component displaying the page name. It is only visible when the item is selected.

  • Icon Image - Reference to the Image component that is animated on selection and deselection.

  • Selected Icon Size - Icon size when selected. Should be slightly larger than when unselected.

  • Unselected Icon Size - Icon size when not selected.

  • Selected Icon Position - Anchored position of the icon when selected (usually slightly higher).

  • Unselected Icon Position - Anchored position of the icon when not selected.

You can freely adjust these sizes and positions to better fit your desired UI style.

Dock Item Behavior script

The MainMenuDockItemBehavior script controls the visuals and interactions of a single dock item. It defines two properties, one event, and four methods.

Properties:

Event:

Methods:

Last updated