UGTK cat mascotUGTKengine within an engine Request access

UGTK / Toolkit / Ui Module / Element Cycler System Completed

Ui Module — UGTK

Element Cycler System

Summary

The Element Cycler System cycles through a keyed collection of elements (2D sprites or 3D prefabs) with next/previous navigation, selection by index or identifier, and a string event fired on every change.


Content


Modules Dependencies

This module depends on the UGTK DictionarySystem (UGTK.Data.DictionarySystem), used by the SO_ElementsCyclers2D/3D ScriptableObjects to store the keyed element dictionaries.


Setup

Drop the ElementCycler prefab under a Canvas (or CyclerPanel for the version with the next/previous buttons already wired):


How To Use

  1. Create an SO_ElementsCyclers2D (string → Sprite) or SO_ElementsCyclers3D (string → prefab) asset and fill its dictionary.
  2. Add Mn_ElementCycler2D (assign the elements asset and a target Image) or Mn_ElementCycler3D for prefabs.
  3. Drive it from UI buttons/code with NextElement(), PreviousElement(), SetElementByIndex(int) or SetElementByIdentifier(string).
  4. Read the current key with GetCurrentElementIdentifier() and subscribe to onChangeElement (UnityEvent<string>) to react to the active element's key.

Good to know:


Testing Scene

Open Debug/ElementCyclerScene.unity and press Play: the next/previous buttons run through the dictionary and the key of the active element is reported.


Technical Info


© 2026 Marcello De Bonis. All rights reserved

Real dependenciesOpen in the map →

Depends on 1

Used by 1

Measured from the repository: code references (asmdef) plus prefab and asset GUIDs. Importing this module alone brings in 1 module in total.