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
- VisualElement container = item.RightCustomContainer;
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.Add( toggle );
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.RightCustomContainer.Q<ActivationToggle>()?.UnbindGameObject();
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
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name" : "com.soosvet_games.common_tools",
3
3
  "displayName" : "Soosvet Games Common Tools",
4
- "version" : "1.1.9",
4
+ "version" : "1.2.0",
5
5
  "author" : "Soosvet Games",
6
6
  "description" : "Common tools for Unity.",
7
7
  "repository": {