Freyja UI

Requirements

  • Unity 2021.3.22.f1 or later

  • Odin Inspector 3.1.14.3

Dependencies

Name
Tags

com.freyja.logger

1.0.0

Installation

  1. Install from Unity Package Manager -> (Window -> Package Manager -> Add package from git URL)

  1. Copy and Paste this URL link https://github.com/winartodev/Freyja-UI.git

Example Usage

Feature
UI Navigation Grid
UI Navigation Horizontal
UI Navigation Vertical

Best For

Grids, 2D menus

Horizontal tabs

Vertical lists

Dynamic Layout

✅ Yes

❌ No

❌ No

Uses Grid Layout Group

✅ Yes

❌ No

❌ No

UI Navigation Horizontal

Unity UI component that provides horizontal navigation between selectable UI elements.

UI Navigation Vertical

Unity UI component that provides vertical navigation between selectable UI elements (e.g., buttons in a menu).

UI Navigation Grid

A Unity UI component that enables full 2D directional navigation (up/down/left/right) between selectable elements arranged in a grid layout.

Notes:

  • 🚫 Content Size Fitter Incompatibility Avoid using any Content Size Fitter component (including both "Preferred Size" and "Min Size" modes) as they will freeze the SizeDelta values, breaking the grid navigation calculations.

Before

After

Layout Rebuilder Component

Unity UI Component that forces immediate UI layout recalculations, ensuring proper rendering of dynamic UI elements.

Inspector Options

Properties
Descriptions

Rebuild On Start [bool]

If enabled, automatically rebuilds on game start

Layout [Rect Transform]

The UI element to rebuild (required)

Example Use Case

// Manual rebuild call
GetComponent<UILayoutRebuilder>().RebuildLayout(myPanel);

Selections

Unity UI component that manages and tracks selection states for interactive UI elements. Provides functionality for programmatic selection, navigation between elements, and maintaining selection state.

Inspector Options

Properties
Descriptions

Always Get First Index [bool]

If enabled, always returns first element when calling GetLatestSelection()

Selectables [ []Selectable ]

The UI elements to manage (buttons, toggles, etc.)

Core Functionality

Selection Management

// Get current/last selected element
Selectable current = GetLatestSelection();

// Select by index (with bounds checking)
Selectable thirdItem = GetSelectable(2); 

// Select by GameObject name
SelectUI("InventoryButton");

Navigation Controls

// Move to next/previous with wrap-around
GetNextSelection(); 
GetPreviousSelection();

Example Use Case

// Controller navigation
void Update() {
    if(Input.GetButtonDown("Right")) {
        GetNextSelection();
        EventSystem.current.SetSelectedGameObject(GetLatestSelection().gameObject);
    }
}

// Programmatic menu control
public void OpenInventory() {
    SelectUI("InventoryTab");
}

Last updated