You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
WARNING: The following changes may affect your project if you're updating from an older version:
- DraggedReferenceSourceUI component's "Object Reference" variable is changed to "Object[] References"
- Moved "Can Drop Parent On Child" and "Can Add Objects To Pseudo Scenes" properties from HierarchyDragDropListener to RuntimeHierarchy
- "hierarchy.Select(someTransform)" function's equivalent is now "hierarchy.Select(someTransform, RuntimeHierarchy.SelectOptions.FocusOnSelection)"
- RuntimeHierarchy's "Create Dragged References On Hold" property is changed to "Pointer Long Press Action"
Release Notes:
- Added "Multi Selection" option to RuntimeHierarchy:
-- SelectionChangedDelegate now takes ReadOnlyCollection<Transform> parameter
-- CurrentSelection returns ReadOnlyCollection<Transform>
-- Select function has a variant that takes IList<Transform>
-- Deselect function has variants that allow deselecting only a subset of the selection
-- Added IsSelected function to check if a Transform is selected
- Added tooltip support to RuntimeHierarchy (when enabled, hovering the cursor over a Transform for a while will display its name in a tooltip)
- Added "bool IsLocked" property to RuntimeInspector and RuntimeHierarchy which prevents changing the inspected/selected object from outside (similar to Unity's own Inspector lock)
- Space between expand arrow and the label next to it is now configurable via UISkin
- Expand arrows now scale correctly with UISkin's Line Height
Copy file name to clipboardExpand all lines: .github/README.md
+47-23Lines changed: 47 additions & 23 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# Runtime Inspector & Hierarchy for Unity 3D
2
2
3
-

3
+

4
4
5
5
**Available on Asset Store:**https://assetstore.unity.com/packages/tools/gui/runtime-inspector-hierarchy-111349
6
6
@@ -51,20 +51,22 @@ This plugin supports Unity's new Input System but it requires some manual modifi
51
51
52
52
## E. FEATURES
53
53
54
-
- The hierarchy costs **1 SetPass call** and **~5 batches** (assuming that **Sprite Packing** is enabled in *Editor Settings*)
55
-
- The inspector costs **1 SetPass call** and **~10 batches** (assuming that **Sprite Packing** is enabled in *Editor Settings*)
56
-
- Both panels are heavily optimized in terms of GC in order not to generate any unnecessary garbage. By default, both the inspector and the hierarchy are refreshed 4 times a second to reflect any changes to their user interface almost immediately. Each refresh of the inspector generates some garbage for GC since most of the time, the inspected object has variables of value types. These variables are *boxed* when accessed via reflection and this boxing creates some unavoidable garbage. However, this process can be greatly optimized by increasing the **Refresh Interval** of the inspector and/or the hierarchy
54
+
- Both panels are heavily optimized in terms of GC in order not to cause any unnecessary allocations. By default, both the inspector and the hierarchy are refreshed 4 times a second to reflect any changes to their user interface almost immediately. Each refresh of the inspector generates some garbage for GC since most of the time, the inspected object has variables of value types. These variables are *boxed* when accessed via reflection and this boxing creates some unavoidable garbage. However, this process can be greatly optimized by increasing the **Refresh Interval** of the inspector and/or the hierarchy
57
55
- Includes a built-in color picker and a reference picker:
58
56
59
-

57
+

60
58
61
59
- Visual appearance of the inspector and the hierarchy can be tweaked by changing their **Skin**. There are two premade skins included in the **Skins** directory: *LightSkin* and *DarkSkin*. You can create your own skins using the **Assets-Create-yasirkula-RuntimeInspector-UI Skin** context menu
62
60
63
-

61
+

62
+
63
+
- The hierarchy supports multi-selection:
64
+
65
+

64
66
65
67
### E.1. INSPECTOR
66
68
67
-

69
+

68
70
69
71
RuntimeInspector works similar to the editor Inspector. It can expose commonly used Unity types out-of-the-box, as well as custom classes and structs that are marked with **System.Serializable** attribute. 1-dimensional arrays and generic Lists are also supported.
70
72
@@ -96,33 +98,40 @@ While changing the inspector's settings, you are advised not to touch **Internal
96
98
97
99
### E.2. HIERARCHY
98
100
99
-

101
+

100
102
101
103
RuntimeHierarchy simply exposes the objects in your scenes to the user interface. In addition to exposing the currently active Unity scenes in the hierarchy, you can also expose a specific set of objects under what is called a **pseudo-scene** in the hierarchy. Pseudo-scenes can help you categorize the objects in your scene. Adding/removing objects to/from pseudo-scenes is only possible via the scripting API and helper components.
102
104
103
105
-**Refresh Interval**: the refresh interval of the hierarchy. At each refresh, the destroyed objects are removed from the hierarchy while newly created objects are added to the hierarchy. Sibling indices of the objects are also synced with the Unity Hierarchy at each refresh
104
106
-**Object Names Refresh Interval**: accessing **GameObject.name** property generates garbage. Therefore, names of objects in the hierarchy are not synced at each *Refresh Interval* but rather at each *Object Names Refresh Interval* to help avoid excessive garbage
105
107
-**Search Refresh Interval**: the refresh interval for the search results. At each refresh, each GameObject's name is checked to see if it matches the searched term, so this process will generate some garbage
108
+
-**Allow Multi Selection**: when disabled, only a single Transform can be selected in the hierarchy
106
109
-**Expose Unity Scenes**: when disabled, Unity scenes are not exposed in the hierarchy. This is useful when you want to use the hierarchy solely for pseudo-scenes
107
-
-**Exposed Scenes**: specifies the scenes that are exposed in the hierarchy by their name. When empty, all scenes are exposed
110
+
-**Exposed Unity Scenes Subset**: specifies the scenes that are exposed in the hierarchy by their name. When empty, all scenes are exposed
108
111
-**Expose Dont Destroy On Load Scene**: when enabled, *DontDesroyOnLoad* objects will be exposed in the hierarchy
109
112
-**Pseudo Scenes Order**: the order of the pseudo-scenes from top to bottom in the hierarchy. Note that entering a pseudo-scene here does not automatically create it when the application starts. Pseudo-scenes can be created via the scripting API only
110
-
-**Create Dragged Reference On Hold**: when enabled, if you click and hold on an object in the hierarchy for a while, a **dragged reference item** will be created that can be dropped on a *reference drawer* in the inspector to assign that object to that variable (similar to Unity's drag&drop reference assignment)
111
-
-**Dragged Reference Hold Time**: this value defines the hold time in seconds before a dragged reference item is created
112
-
-**Can Reorganize Items**: when enabled, dropping a dragged reference item that holds a Transform onto an object in the hierarchy will change the dragged Transform's parent (similar to parenting in Unity's Hierarchy)
113
+
-**Pointer Long Press Action**: determines what will happen when an object is clicked and then held for a while:
114
+
-**None**: nothing ¯\\\_(ツ)\_/¯
115
+
-**Create Dragged Reference Item**: creates a **dragged reference item** that can be dropped onto a *reference drawer* in the inspector to assign the held object(s) to that variable (similar to Unity's drag&drop reference assignment)
116
+
-**Show Multi Selection Toggles**: displays multi-selection toggles in front of each object. This is mostly useful on mobile devices where CTRL and Shift keys aren't present. Has no effect if *Allow Multi Selection* is disabled
117
+
-**Show Multi Selection Toggles Then Create Dragged Reference Item**: if multi-selection toggles aren't visible, displays them. Otherwise, creates a dragged reference item
118
+
-**Pointer Long Press Duration**: determines how long an object should be held until the *Pointer Long Press Action* is executed
113
119
-**Double Click Threshold**: when an object in the hierarchy is double clicked, **OnItemDoubleClicked** event is raised (see *SCRIPTING API*). This value determines the maximum allowed delay between two clicks to register a double click
120
+
-**Can Reorganize Items**: when enabled, dropping a dragged reference item that holds Transform(s) onto an object in the hierarchy will change the dragged Transform(s)' parents (similar to parenting in Unity's Hierarchy)
121
+
-**Can Drop Dragged Parent On Child**: when enabled, a dragged reference item can be dropped onto one of its child objects. In this case, the child object will be unparented and then the dragged reference item will become a child of it. Has no effect if *Can Reorganize Items* is disabled
122
+
-**Can Drop Dragged Objects To Pseudo Scenes**: when enabled, dropping a dragged reference item onto a pseudo-scene or above/below a root object in the pseudo-scene will automatically add it to that pseudo-scene. Has no effect if *Can Reorganize Items* is disabled
123
+
-**Show Tooltips**: when enabled, hovering over an object for a while will show a tooltip displaying the object's name. Can be useful for objects with very long names
124
+
-**Tooltip Delay**: determines how long the cursor should remain static over an object before the tooltip appears. Has no effect if *Show Tooltips* is disabled
114
125
-**Show Horizontal Scrollbar**: when enabled, a horizontal scrollbar will be displayed if the names displayed in the hierarchy don't fit the available space. Note that only the visible items' width values are used to determine the size of the scrollable area
115
126
-**Sync Selection With Editor Hierarchy**: simply synchronizes the selected object between the Unity Hierarchy and this RuntimeHierarchy
116
127
117
128
Additional settings for *Can Reorganize Items* can be found at the *RuntimeHierarchy/ScrollView/Viewport* object:
-**Sibling Index Modification Area**: when a dragged reference item is dropped near the top or bottom edges of a Transform in hierarchy, it will be inserted above or belove the target Transform. This value determines the size of the area near the top and bottom edges
122
133
-**Scrollable Area**: while hovering the cursor near the top or bottom edges of the scroll view with a dragged reference item, scroll view will automatically be scrolled to show contents in that direction. This value determines the size of the area near the top and bottom edges of the scroll view
123
134
-**Scroll Speed**: determines how fast the scroll view will be scrolled while hovering the cursor over *Scrollable Area*
124
-
-**Can Drop Parent On Child**: when enabled, a dragged reference item can be dropped onto one of its child objects. In this case, the child object will be unparented and then the dragged reference item will become a child of it
125
-
-**Can Add Objects To Pseudo Scenes**: when enabled, dropping a dragged reference item onto a pseudo-scene or above/below a root object in the pseudo-scene will automatically add it to that pseudo-scene
126
135
127
136
## F. SCRIPTING API
128
137
@@ -139,12 +148,26 @@ public void StopInspect();
139
148
- You can change the selected object in the hierarchy using the following functions:
140
149
141
150
```csharp
142
-
publicboolSelect( Transformselection ); // returns true when the selection is changed successfully
143
-
publicvoidDeselect();
151
+
// SelectOptions is an enum flag meaning that it can take multiple values with | (OR) operator. These values are:
152
+
// - Additive: new selection will be appended to the current selection instead of replacing it
153
+
// - FocusOnSelection: scroll view will be snapped to the selected object(s)
154
+
// - ForceRevealSelection: normally, when selection changes, the new selection will be fully explored in the hierarchy (i.e. all of the parents of the selection will be
155
+
// expanded to reveal the selection). This doesn't automatically happen if selection doesn't change. When this flag is set, however, the selected objects will be fully
156
+
// revealed/explored even if the selection doesn't change
157
+
publicboolSelect( Transformselection, SelectOptionsselectOptions=SelectOptions.None ); // Selects the specified Transform. Returns true when the selection is changed successfully
158
+
publicboolSelect( IList<Transform>selection, SelectOptionsselectOptions=SelectOptions.None ); // Selects the specified Transform(s)
159
+
160
+
publicvoidDeselect(); // Deselects all Transforms
161
+
publicvoidDeselect( Transformdeselection ); // Deselects only the specified Transform
162
+
publicvoidDeselect( IList<Transform>deselection ); // Deselects only the specified Transform(s)
163
+
164
+
publicboolIsSelected( Transformtransform ); // Returns true if the selection includes the Transform
144
165
```
145
166
146
-
- You can access the currently selected object in the hierarchy via the `CurrentSelection` property
167
+
- You can access the currently selected object(s) in the hierarchy via the `CurrentSelection` property
168
+
- Hierarchy's multi-selection toggles can be enabled manually via the `MultiSelectionToggleSelectionMode` property
147
169
- You can call the `Refresh()` function on the inspector and/or the hierarchy to refresh them manually
170
+
- You can lock the inspector and/or the hierarchy via the `IsLocked` property
148
171
- You can register to the `OnSelectionChanged` event of the hierarchy to get notified when the selection has changed
149
172
- You can register to the `OnInspectedObjectChanging` delegate of the inspector to get notified when the inspected object is about to change and, if you prefer, change the inspected object altogether. For example, if you want to inspect only objects that have a *Renderer* component attached, you can use the following function:
150
173
@@ -270,12 +293,13 @@ private Object CreateDraggedReferenceItemForNPCsOnly( RaycastHit hit )
270
293
}
271
294
```
272
295
273
-
-**DraggedReferenceSourceUI**: when assigned to a UI element, that element can create a dragged reference item for its **Reference** object after it is clicked and held for a while
296
+
-**DraggedReferenceSourceUI**: when assigned to a UI element, that element can create a dragged reference item for its **References** object(s) after it is clicked and held for a while
274
297
275
-
You can also use your own scripts to create dragged reference items by calling the following function in the **RuntimeInspectorUtils** class:
298
+
You can also use your own scripts to create dragged reference items by calling the following functions in the **RuntimeInspectorUtils** class:
0 commit comments