UIManager
UI Manager is a Unity-based library for the game ROUNDS that simplifies the creation, customization, and runtime management of UI panels.
模組介紹 作者原文
UI Manager [1.0.0]
UI Manager is a Unity-based library for the game _ROUNDS_ that simplifies the creation, customization, and runtime management of UI panels.
It provides a flexible system for building draggable, resizable, and configurable UI panels, along with a powerful UI Layout Manager that allows editing using a runtime gizmo.
Core Features
UI Layout Manager (Main Feature)
The UI Layout Manager enables runtime manipulation of UI panels:
- Drag panels freely across the screen
- Resize panels dynamically
- Edit layouts visually using a runtime gizmo
This allows both developers and players to fully customize UI positioning.
Option Panels
Create dynamic and customizable Option Panels for your UI:
- Built-in support for sliders, toggles, and color pickers
- Automatically generated UI via reflection
- Real-time property updates
Example: Tabholic
The Tabholic mod demonstrates how to use UI Manager in practice.
It uses:
- Layoutable Panel for structured UI organization
- Option Panels for user customization (text color, spacing, size, etc.)
Example behavior:
private void Awake() {
UIPanelInfo panel = GetComponentInParent();
panel.OnDisplayModeChnaged += (DisplayMode display) => {
if (display == DisplayMode.Normal) {
CreatePlayerStats();
} else if (display == DisplayMode.Layout) {
CreatePreviewStats();
}
};
}
Getting Started
This library currently supports Unity Project-based mods only.
It is not designed for mods developed purely in external IDEs like Visual Studio.
- Creating a UI Panel
- Import UI Manager into your Unity project
- Set up dependencies for your mod
- Open the example scene: Example UI Panels
- Duplicate one of the example panels
- Disable unused example panels
- Configure your panel:
- Set a unique PanelID in UIPanelInfo
- Adjust other settings as needed
- Registering UI Panels
- Create a GameObject with UIPanelRegistrar
- Convert your panels into prefabs
- Assign prefabs to the UIPanelRegistrar
- Convert the registrar into a prefab
- Load and register panels at runtime:
UIPanelRegistrar registrar = Assets.LoadAsset("Tabholic UI Register").GetComponent();
registrar.Register();
- Displaying Panels
// Display ALL panels
foreach (var panel in registrar.UIPanelsPrefabs) {
UIRegistry.Instance.GetLayoutPanel(panel.PanelID).Info.DisplayMode = DisplayMode.Normal;
}
// Display a specific panel
registrar.GetLayoutPanel("MyPanelId").Info.DisplayMode = DisplayMode.Normal;
Creating an Option Panel (Optional)
Step 1: Define the Panel Class
Create a class inheriting from SimpleContextPanel.
This system uses reflection to automatically generate UI fields from properties implementing IPropertyField.
public class MyPanelOptionPanel: SimpleContextPanel {
public static MyPanelOptionPanel Instance { get; private set; }
public FloatPropertyField MyFloat = new FloatPropertyField(0f, 1f, 0f);
public IntPropertyField MyInt = new IntPropertyField(0, 1, 0);
public BoolPropertyField MyBool = new BoolPropertyField(false);
private void Awake() {
Instance = this;
}
}
Step 2: Register the Option Panel
UIPanelInfo panelInfo = registrar.UIPanelsPrefabs.First();
OptionPanelRegistry.RegisterOptionMenu(panelInfo);
(Optional) Editor Testing
public class EditorContextPanelRegister: MonoBehaviour {
public UIPanelInfo PrefabPanelInfo;
private void Awake() {
OptionPanelRegistry.RegisterOptionMenu(PrefabPanelInfo);
}
}
Step 3: Access Values
MyPanelOptionPanel.Instance.MyFloat.Value;
MyPanelOptionPanel.Instance.MyBool.Value;
Notes
- UI appearance in Unity Editor will differ from in-game visuals due to ROUNDS post-processing
- Ensure unique PanelID values to avoid conflicts
安裝與使用 安裝:BepInEx 外掛
- 本站下載的壓縮包就是模組本體,通常是 BepInEx 外掛(解壓後得到 .dll 或外掛資料夾)。
- 建議流程:用社群模組管理器(如 r2modman)選中本遊戲後匯入該模組,管理器會自動裝好 BepInEx 前置並處理依賴。
- 手動流程:先在遊戲目錄裝好 BepInEx 載入器,再把解壓出的 .dll 或外掛資料夾放進 BepInEx/plugins/。
- 啟動遊戲,BepInEx 控制台會列印載入日誌;確認這個模組出現在日誌裡即為安裝成功。
帶「前置依賴」的模組需要一併安裝,否則不會載入。功能開關通常在遊戲內或外掛自帶的設定檔裡調整。
下面這些內容需要先安裝,否則該模組不會生效: