Skip to content

Commit 5ea2204

Browse files
committed
docs: documentation update with images
chore: added tootips and info explanation to the Ui Presenter Manager window
1 parent f6e08b1 commit 5ea2204

File tree

7 files changed

+398
-43
lines changed

7 files changed

+398
-43
lines changed

Editor/UiPresenterManagerWindow.cs

Lines changed: 46 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,19 @@ public class UiPresenterManagerWindow : EditorWindow
2020
private double _lastRefreshTime;
2121
private const double RefreshInterval = 0.5; // seconds
2222

23+
private const string StatsExplanation =
24+
"Stats Summary\n\n" +
25+
"• Total: Number of presenter instances currently loaded in memory.\n" +
26+
"• Opened: Presenters that are currently visible (tracked by UiService.VisiblePresenters).\n" +
27+
"• Closed: Presenters loaded in memory but hidden (ready to reopen without reloading).";
28+
29+
private const string PresenterExplanation =
30+
"Presenter List\n\n" +
31+
"• Presenter Type: The class name of the UiPresenter component, click to ping the presenter GameObject in the scene.\n" +
32+
"• Status: Green dot = visible, Red dot = loaded but hidden.\n" +
33+
"• Actions: OPEN/CLOSE toggles visibility; Unload removes from memory.\n" +
34+
"• Instance: Multi-instance address ('(default)' for singleton presenters).";
35+
2336
private ScrollView _scrollView;
2437
private Label _statsLabel;
2538

@@ -58,6 +71,11 @@ private void CreateGUI()
5871
var header = CreateHeader();
5972
root.Add(header);
6073

74+
// Stats explanation
75+
var statsHelpBox = new HelpBox(StatsExplanation, HelpBoxMessageType.Info);
76+
statsHelpBox.style.marginBottom = 5;
77+
root.Add(statsHelpBox);
78+
6179
// Stats bar
6280
_statsLabel = new Label();
6381
_statsLabel.style.paddingLeft = 10;
@@ -66,8 +84,14 @@ private void CreateGUI()
6684
_statsLabel.style.backgroundColor = new Color(0.15f, 0.15f, 0.15f);
6785
_statsLabel.style.unityFontStyleAndWeight = FontStyle.Bold;
6886
_statsLabel.enableRichText = true;
87+
_statsLabel.tooltip = "Total: loaded in memory | Opened: visible | Closed: hidden but loaded";
6988
root.Add(_statsLabel);
7089

90+
// Presenter list explanation
91+
var presenterHelpBox = new HelpBox(PresenterExplanation, HelpBoxMessageType.Info);
92+
presenterHelpBox.style.marginBottom = 5;
93+
root.Add(presenterHelpBox);
94+
7195
// Column Headers
7296
var columnHeaders = CreateColumnHeaders();
7397
root.Add(columnHeaders);
@@ -165,6 +189,14 @@ private Label CreateHeaderLabel(string text, int columnIndex)
165189
ApplyColumnStyle(label, columnIndex);
166190
label.style.unityFontStyleAndWeight = FontStyle.Bold;
167191
label.style.paddingLeft = 10;
192+
label.tooltip = columnIndex switch
193+
{
194+
0 => "The UiPresenter component class name",
195+
1 => "Green = visible, Red = hidden",
196+
2 => "Open/Close toggles visibility; Unload removes from memory",
197+
3 => "Instance address for multi-instance presenters",
198+
_ => ""
199+
};
168200
return label;
169201
}
170202

@@ -231,11 +263,20 @@ private VisualElement CreatePresenterRow(GameLovers.UiService.UiService service,
231263
row.style.backgroundColor = new Color(1, 1, 1, 0.03f);
232264
}
233265

234-
// Type (column 0)
235-
var typeLabel = new Label(instance.Type.Name);
236-
ApplyColumnStyle(typeLabel, 0);
237-
typeLabel.style.paddingLeft = 10;
238-
row.Add(typeLabel);
266+
// Type button (column 0) - clickable to select in hierarchy
267+
var typeButton = new Button(() =>
268+
{
269+
Selection.activeGameObject = instance.Presenter.gameObject;
270+
EditorGUIUtility.PingObject(instance.Presenter.gameObject);
271+
if (SceneView.lastActiveSceneView != null)
272+
{
273+
SceneView.lastActiveSceneView.FrameSelected();
274+
}
275+
}) { text = instance.Type.Name };
276+
ApplyColumnStyle(typeButton, 0);
277+
typeButton.style.marginLeft = 5;
278+
typeButton.style.marginRight = 5;
279+
row.Add(typeButton);
239280

240281
// Status (column 1)
241282
var statusContainer = new VisualElement();

README.md

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,11 @@
22

33
[![Unity Version](https://img.shields.io/badge/Unity-6000.0%2B-blue.svg)](https://unity3d.com/get-unity/download)
44
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
5-
[![Version](https://img.shields.io/badge/version-1.0.0-green.svg)](CHANGELOG.md)
5+
[![Version](https://img.shields.io/badge/version-1.2.0-green.svg)](CHANGELOG.md)
66

77
> **Quick Links**: [Installation](#installation) | [Quick Start](#quick-start) | [Documentation](docs/README.md) | [Examples](#examples) | [Troubleshooting](docs/troubleshooting.md)
88
9-
<!-- TODO: Add a demo GIF or video showing the UiService in action -->
10-
<!-- Recommended content:
11-
- Opening/closing UI presenters with animations
12-
- Layer management demonstration
13-
- Editor windows (Analytics Window, Hierarchy Window)
14-
- UI Sets batch operations
15-
-->
16-
17-
![UiService Demo](docs/images/demo.gif)
9+
![UiService Demo](docs/demo.gif)
1810

1911
## Why Use This Package?
2012

docs/core-concepts.md

Lines changed: 32 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,45 @@ This document covers the fundamental concepts of the UI Service: presenters, lay
44

55
## Table of Contents
66

7+
- [Editor Windows](#editor-windows)
78
- [Service Interfaces](#service-interfaces)
89
- [UI Presenter](#ui-presenter)
910
- [Presenter Features](#presenter-features)
1011
- [UI Layers](#ui-layers)
1112
- [UI Sets](#ui-sets)
1213
- [Multi-Instance Support](#multi-instance-support)
1314
- [UI Configuration](#ui-configuration)
14-
- [Editor Windows](#editor-windows)
15+
16+
---
17+
18+
## Editor Windows
19+
20+
The package includes unified tools for development and debugging.
21+
22+
### Presenter Manager Window
23+
24+
**Menu:** `Tools → UI Service → Presenter Manager`
25+
26+
![UiConfigs Inspector](presenter-manager.png)
27+
28+
Manage active and loaded UI presenters in real-time during play mode:
29+
- View all loaded presenters and their current status (Open/Closed)
30+
- Quick Open/Close/Unload actions per instance
31+
- Bulk operations: Close All, Unload All
32+
- Status indicators: 🟢 Open, 🔴 Closed
33+
34+
### UiConfigs Inspector
35+
36+
**Menu:** `Tools → UI Service → Select Ui Configs`
37+
38+
![UiConfigs Inspector](uiconfigs-inspector.gif)
39+
40+
Select any `UiConfigs` asset to see the enhanced inspector:
41+
- Visual layer hierarchy
42+
- Color-coded layers
43+
- Drag & drop reordering
44+
- Statistics panel
45+
- UI set management
1546

1647
---
1748

@@ -650,30 +681,3 @@ var dynamicUi = Instantiate(uiPrefab);
650681
_uiService.AddUi(dynamicUi, layer: 3, openAfter: true);
651682
```
652683

653-
---
654-
655-
## Editor Windows
656-
657-
The package includes unified tools for development and debugging.
658-
659-
### Presenter Manager Window
660-
661-
**Menu:** `Tools → UI Service → Presenter Manager`
662-
663-
Manage active and loaded UI presenters in real-time during play mode:
664-
- View all loaded presenters and their current status (Open/Closed)
665-
- Quick Open/Close/Unload actions per instance
666-
- Bulk operations: Close All, Unload All
667-
- Status indicators: 🟢 Open, 🔴 Closed
668-
669-
### UiConfigs Inspector
670-
671-
![UiConfigs Inspector](uiconfigs-inspector.gif)
672-
673-
Select any `UiConfigs` asset to see the enhanced inspector:
674-
- Visual layer hierarchy
675-
- Color-coded layers
676-
- Drag & drop reordering
677-
- Statistics panel
678-
- UI set management
679-

docs/demo.gif

Lines changed: 3 additions & 0 deletions
Loading

docs/demo.gif.meta

Lines changed: 156 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/presenter-manager.png

Lines changed: 3 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)