com.soosvet_games.common_tools 1.1.9 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -34,12 +34,17 @@ namespace SoosvetGames.CommonTools.Extensions.Editor
|
|
|
34
34
|
if ( gameObject == null )
|
|
35
35
|
return;
|
|
36
36
|
|
|
37
|
-
|
|
37
|
+
// The icon follows the foldout in the row's indented content.
|
|
38
|
+
VisualElement icon = item.Icon;
|
|
39
|
+
VisualElement container = icon.parent;
|
|
40
|
+
if ( container == null )
|
|
41
|
+
return;
|
|
42
|
+
|
|
38
43
|
ActivationToggle toggle = container.Q<ActivationToggle>();
|
|
39
44
|
if ( toggle == null )
|
|
40
45
|
{
|
|
41
46
|
toggle = new ActivationToggle();
|
|
42
|
-
container.
|
|
47
|
+
container.hierarchy.Insert( container.hierarchy.IndexOf( icon ), toggle );
|
|
43
48
|
}
|
|
44
49
|
|
|
45
50
|
toggle.BindGameObject( gameObject );
|
|
@@ -47,7 +52,7 @@ namespace SoosvetGames.CommonTools.Extensions.Editor
|
|
|
47
52
|
|
|
48
53
|
private static void UnbindItem( HierarchyWindow window, HierarchyView view, HierarchyViewItem item )
|
|
49
54
|
{
|
|
50
|
-
item.
|
|
55
|
+
item.Q<ActivationToggle>()?.UnbindGameObject();
|
|
51
56
|
}
|
|
52
57
|
|
|
53
58
|
private sealed class ActivationToggle : Toggle
|
|
@@ -60,6 +65,7 @@ namespace SoosvetGames.CommonTools.Extensions.Editor
|
|
|
60
65
|
name = "soosvet-hierarchy-activation-toggle";
|
|
61
66
|
tooltip = "Set GameObject Active";
|
|
62
67
|
focusable = false;
|
|
68
|
+
style.flexShrink = 0;
|
|
63
69
|
style.marginTop = 0;
|
|
64
70
|
style.marginBottom = 0;
|
|
65
71
|
|