com.soosvet_games.common_tools 1.1.5 → 1.1.6

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.
@@ -9,15 +9,17 @@ namespace SoosvetGames.CommonTools.Extensions.Editor
9
9
  static HierarchyActivationTool()
10
10
  {
11
11
  #if UNITY_6000_5_OR_NEWER
12
+ EditorApplication.hierarchyWindowItemByEntityIdOnGUI -= HierarchyWindowOnGui;
12
13
  EditorApplication.hierarchyWindowItemByEntityIdOnGUI += HierarchyWindowOnGui;
13
14
  #else
15
+ EditorApplication.hierarchyWindowItemOnGUI -= HierarchyWindowOnGui;
14
16
  EditorApplication.hierarchyWindowItemOnGUI += HierarchyWindowOnGui;
15
17
  #endif
16
18
  }
17
19
 
18
20
  #if UNITY_6000_5_OR_NEWER
19
21
 
20
- private static void HierarchyWindowOnGui( EntityId entityId,Rect selectionRect )
22
+ private static void HierarchyWindowOnGui(EntityId entityId, Rect selectionRect)
21
23
  {
22
24
  var obj = EditorUtility.EntityIdToObject(entityId) as GameObject;
23
25
 
@@ -28,7 +30,7 @@ namespace SoosvetGames.CommonTools.Extensions.Editor
28
30
 
29
31
  private static void HierarchyWindowOnGui( int instanceId, Rect selectionRect )
30
32
  {
31
- var obj = EditorUtility.InstanceIDToObject( instanceId ) as GameObject;
33
+ var obj = Resources.InstanceIDToObject( instanceId ) as GameObject;
32
34
 
33
35
  DrawToggle( obj, selectionRect );
34
36
  }
@@ -43,7 +45,8 @@ namespace SoosvetGames.CommonTools.Extensions.Editor
43
45
  var rect = new Rect( selectionRect ) { x = 35, width = 18 };
44
46
 
45
47
  bool previousValue = obj.activeSelf;
46
- bool newValue = GUI.Toggle( rect, previousValue, string.Empty );
48
+
49
+ bool newValue = GUI.Toggle( rect, previousValue, GUIContent.none );
47
50
 
48
51
  if ( newValue == previousValue )
49
52
  return;
@@ -53,6 +56,8 @@ namespace SoosvetGames.CommonTools.Extensions.Editor
53
56
  obj.SetActive( newValue );
54
57
 
55
58
  EditorUtility.SetDirty( obj );
59
+
60
+ EditorApplication.RepaintHierarchyWindow();
56
61
  }
57
62
  }
58
63
  }
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.5",
4
+ "version" : "1.1.6",
5
5
  "author" : "Soosvet Games",
6
6
  "description" : "Common tools for Unity.",
7
7
  "repository": {