English | 中文文档 (Chinese)
RicKit UI is an asynchronous Unity UI management plugin supporting stack-based management, animation, and custom resource loading.
It is ideal for Unity projects that require efficient and flexible UI control.
- Sample projects can be found under
Samplesin RicKit UI in the Package Manager. - WebGL Online Demo
- Via Package Manager
- Open
Edit > Project Settings > Package Manager - Add a custom Registry (international, real-time update):
- Name: package.openupm.com
- URL: https://package.openupm.com
- Scope(s):
com.rickit.ui,com.cysharp.unitask
- In
Window > Package Manager, selectMy Registriesin the upper left and refresh. Download RicKit UI.
- Open
- Stack-based UI management: Supports enter/exit animations and auto input blocking during transitions.
- Esc key returns by default, Esc is ignored during animations.
- Before use, set all parameters under
Resources/UISettings(e.g., CurvingMasks, SortingLayerName, resolution, etc.). - Create UISettings via the menu:
Rickit => UI => Create UISettings. - First use: manually call
UIManager.Init()to automatically create core components likeUICam,Blocker. - To create a custom UIPanel, inherit from
AbstractUIPanel. The created window prefab can be edited in the inspector.
RicKit UI manages UI through IUIManager, supports both synchronous and asynchronous usage. Main APIs:
- Initialization & Settings
UIManager.Init()/UIManager.Init(panelLoader)
- Show & Switch Panels
ShowUI<T>()/ShowUIAsync<T>()HideThenShowUI<T>()/HideThenShowUIAsync<T>()CloseThenShowUI<T>()/CloseThenShowUIAsync<T>()ShowUIUnmanagable<T>()ShowThenClosePrev<T>()/ShowThenClosePrevAsync<T>()
- Back & Stack Operations
Back()/BackAsync()CloseCurrent()/CloseCurrentAsync()HideCurrent()/HideCurrentAsync()CloseUntil<T>()/CloseUntilAsync<T>()BackThenShow<T>()/BackThenShowAsync<T>()Close<T>/CloseAsync<T>()
- Preload & Await
PreloadUI<T>()/PreloadUIAsync<T>()WaitUntilUIHideEnd<T>()
- Other Helpers
GetUI<T>()ClearAll()SetLockInput(bool)/IsLockInput()- Event delegates:
OnShow,OnHide, etc.
Note: Generic
Tmust inherit fromAbstractUIPanel.
Asynchronous management is recommended for complex transitions, all async APIs rely on UniTask.
Supports custom UI resource loading by implementing IPanelLoader and passing it during initialization:
// 1. Resources loading (sync/async)
public class MyPanelLoader : IPanelLoader
{
// Synchronous
public GameObject LoadPrefab(string path)
=> Resources.Load<GameObject>(path);
// Asynchronous
public async UniTask<GameObject> LoadPrefabAsync(string path)
{
var req = Resources.LoadAsync<GameObject>(path);
await UniTask.WaitUntil(() => req.isDone);
return req.asset as GameObject;
}
}
// 2. Addressables loading
public class AddressablesPanelLoader : IPanelLoader
{
public GameObject LoadPrefab(string path)
=> Addressables.LoadAssetAsync<GameObject>(path).WaitForCompletion();
public async UniTask<GameObject> LoadPrefabAsync(string path)
=> await Addressables.LoadAssetAsync<GameObject>(path);
}
// Usage
UIManager.Init(new MyPanelLoader());- To overlay UI camera on a game camera, add the
UniversalRenderPipelineCamStackUICamscript. - If only using a UI camera, no extra steps needed.
- QQ Group: 851024152
- Issues and suggestions are welcome!
