UI System - Overview
AchEngine UI System is a layer-based UI management system.
Views registered in UIViewCatalog can be shown or closed by ID or type, and it includes object pooling, transition animations, and single-instance mode out of the box.
Core Components
| Class | Role |
|---|---|
UIRoot | Root canvas manager for every layer |
UIBootstrapper | Initializes the UI system when the scene starts |
IUIService / UI | Facade for showing and hiding views |
UIView | Base class for every view |
UIViewCatalog | ScriptableObject that registers view prefabs |
UIViewPool | Pool for reusing view instances |
Layer Structure
Open / Close Views
var ui = ServiceLocator.Resolve<IUIService>();
// -- Open ------------------------------------------------
ui.Show("MainMenu"); // By string ID
ui.Show<MainMenuView>("MainMenu"); // Type + ID (returns typed view)
ui.Show("ItemDetail", new ItemPayload(item)); // ID + payload
// -- Close -----------------------------------------------
ui.Close("MainMenu"); // By string ID
ui.CloseTopmost(); // Close the topmost open view
ui.CloseAll(); // Close everything