com.soosvet_games.common_tools 1.1.1 → 1.1.3

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.
@@ -8,24 +8,9 @@ namespace SoosvetGames.CommonTools.Extensions.Editor
8
8
  {
9
9
  static HierarchyActivationTool()
10
10
  {
11
- #if UNITY_6000_3_OR_NEWER
12
- EditorApplication.hierarchyWindowItemByEntityIdOnGUI += HierarchyWindowOnGui;
13
- #else
14
11
  EditorApplication.hierarchyWindowItemOnGUI += HierarchyWindowOnGui;
15
- #endif
16
12
  }
17
13
 
18
- #if UNITY_6000_3_OR_NEWER
19
-
20
- private static void HierarchyWindowOnGui(EntityId entityId, Rect selectionRect)
21
- {
22
- var obj = EditorUtility.EntityIdToObject(entityId) as GameObject;
23
-
24
- DrawToggle(obj, selectionRect);
25
- }
26
-
27
- #else
28
-
29
14
  private static void HierarchyWindowOnGui( int instanceId, Rect selectionRect )
30
15
  {
31
16
  var obj = EditorUtility.InstanceIDToObject( instanceId ) as GameObject;
@@ -33,8 +18,6 @@ namespace SoosvetGames.CommonTools.Extensions.Editor
33
18
  DrawToggle( obj, selectionRect );
34
19
  }
35
20
 
36
- #endif
37
-
38
21
  private static void DrawToggle( GameObject obj, Rect selectionRect )
39
22
  {
40
23
  if ( obj == null )
@@ -6,9 +6,11 @@ namespace SoosvetGames.CommonTools.Services.VibrationService
6
6
  {
7
7
  public VibrationService()
8
8
  {
9
+ #if (UNITY_IOS || UNITY_ANDROID) && !UNITY_EDITOR
9
10
  Vibration.Init();
11
+ #endif
10
12
  }
11
-
13
+
12
14
  public void Vibrate()
13
15
  {
14
16
  #if UNITY_IOS && !UNITY_EDITOR
@@ -18,28 +20,34 @@ namespace SoosvetGames.CommonTools.Services.VibrationService
18
20
  #endif
19
21
  }
20
22
 
21
- #if UNITY_IOS || UNITY_EDITOR
22
23
  public void VibrateIOS( ImpactFeedbackStyle style )
23
24
  {
24
- #if UNITY_EDITOR
25
- return;
26
- #endif
25
+ #if UNITY_IOS && !UNITY_EDITOR
27
26
  Vibration.VibrateIOS( style );
28
- }
29
27
  #endif
30
-
28
+ }
29
+
31
30
  public void VibrateAndroid( VibrationType type )
32
31
  {
33
- #if UNITY_EDITOR
34
- return;
35
- #endif
36
- switch(type)
32
+ #if UNITY_ANDROID && !UNITY_EDITOR
33
+ switch ( type )
37
34
  {
38
- case VibrationType.Pop: Vibration.VibratePop(); break;
39
- case VibrationType.Peek: Vibration.VibratePeek(); break;
40
- case VibrationType.Nope: Vibration.VibrateNope(); break;
41
- default: throw new ArgumentOutOfRangeException( nameof(type), type, null );
35
+ case VibrationType.Pop:
36
+ Vibration.VibratePop();
37
+ break;
38
+
39
+ case VibrationType.Peek:
40
+ Vibration.VibratePeek();
41
+ break;
42
+
43
+ case VibrationType.Nope:
44
+ Vibration.VibrateNope();
45
+ break;
46
+
47
+ default:
48
+ throw new ArgumentOutOfRangeException( nameof(type), type, null );
42
49
  }
50
+ #endif
43
51
  }
44
52
  }
45
53
  }
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.1",
4
+ "version" : "1.1.3",
5
5
  "author" : "Soosvet Games",
6
6
  "description" : "Common tools for Unity.",
7
7
  "repository": {