com.tunnelsnakes.audiosystem 1.1.3 → 2.0.1

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.
@@ -0,0 +1,34 @@
1
+ //#undef MOREMOUNTAINS_NICEVIBRATIONS_INSTALLED
2
+ //#define MOREMOUNTAINS_NICEVIBRATIONS
3
+ using System.Collections;
4
+ using System.Collections.Generic;
5
+ using UnityEngine;
6
+ #if MOREMOUNTAINS_NICEVIBRATIONS_INSTALLED
7
+ using Lofelt.NiceVibrations;
8
+ #elif MOREMOUNTAINS_NICEVIBRATIONS
9
+ using MoreMountains.NiceVibrations;
10
+ #endif
11
+
12
+ [CreateAssetMenu(fileName = nameof(HapticPresetVibration), menuName = MENU_FOLDER + nameof(HapticPresetVibration))]
13
+ public class HapticPresetVibration : Vibration {
14
+
15
+ #if MOREMOUNTAINS_NICEVIBRATIONS_INSTALLED
16
+ [SerializeField] private HapticPatterns.PresetType _type = HapticPatterns.PresetType.None;
17
+ #elif MOREMOUNTAINS_NICEVIBRATIONS
18
+ [SerializeField] private HapticTypes _type = HapticTypes.None;
19
+ #endif
20
+
21
+ public override void Vibrate() {
22
+ if (CanVibrate) {
23
+ #if MOREMOUNTAINS_NICEVIBRATIONS_INSTALLED
24
+ HapticPatterns.PlayPreset(_type);
25
+ #elif MOREMOUNTAINS_NICEVIBRATIONS
26
+ MMVibrationManager.Haptic(_type, false, true, null);
27
+ #else
28
+ #if UNITY_EDITOR
29
+ Debug.LogWarning("Vibrations are disabled!");
30
+ #endif
31
+ #endif
32
+ }
33
+ }
34
+ }
@@ -1,18 +1,20 @@
1
- {
2
- "name": "com.tunnelsnakes.audiosystem.Runtime",
3
- "references": [
4
- "GUID:ec99747e8eb95ee488f6cfa3a8e647b9",
5
- "GUID:041029188fa88c54f9efffc039b6a1c9",
6
- "GUID:865b414a121ed594e91db2e09f65d38c",
7
- "GUID:c5c32a628b9233446bcce7f67a49d1f4"
8
- ],
9
- "includePlatforms": [],
10
- "excludePlatforms": [],
11
- "allowUnsafeCode": false,
12
- "overrideReferences": false,
13
- "precompiledReferences": [],
14
- "autoReferenced": true,
15
- "defineConstraints": [],
16
- "versionDefines": [],
17
- "noEngineReferences": false
1
+ {
2
+ "name": "com.tunnelsnakes.audiosystem.Runtime",
3
+ "rootNamespace": "",
4
+ "references": [
5
+ "GUID:ec99747e8eb95ee488f6cfa3a8e647b9",
6
+ "GUID:041029188fa88c54f9efffc039b6a1c9",
7
+ "GUID:865b414a121ed594e91db2e09f65d38c",
8
+ "GUID:c5c32a628b9233446bcce7f67a49d1f4",
9
+ "GUID:57a0b9bc628ab4740af4b6f1f0b2e134"
10
+ ],
11
+ "includePlatforms": [],
12
+ "excludePlatforms": [],
13
+ "allowUnsafeCode": false,
14
+ "overrideReferences": false,
15
+ "precompiledReferences": [],
16
+ "autoReferenced": true,
17
+ "defineConstraints": [],
18
+ "versionDefines": [],
19
+ "noEngineReferences": false
18
20
  }
packages/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "com.tunnelsnakes.audiosystem",
3
- "version": "1.1.3",
3
+ "version": "2.0.1",
4
4
  "displayName": "TS AudioSystem",
5
5
  "description": "Audio and vibrations",
6
6
  "license": "proprietary",
@@ -1,26 +0,0 @@
1
- using System.Collections;
2
- using System.Collections.Generic;
3
- using UnityEngine;
4
- #if MOREMOUNTAINS_NICEVIBRATIONS
5
- using MoreMountains.NiceVibrations;
6
- #endif
7
-
8
- [CreateAssetMenu(fileName = nameof(HapticVibration), menuName = MENU_FOLDER + nameof(HapticVibration))]
9
- public class HapticVibration : Vibration {
10
-
11
- #if MOREMOUNTAINS_NICEVIBRATIONS
12
- [SerializeField] private HapticTypes _type = HapticTypes.None;
13
- #endif
14
-
15
- public override void Vibrate() {
16
- if (CanVibrate) {
17
- #if MOREMOUNTAINS_NICEVIBRATIONS
18
- MMVibrationManager.Haptic(_type, false, true, null);
19
- #else
20
- #if UNITY_EDITOR
21
- Debug.LogWarning("Vibrations are disabled!");
22
- #endif
23
- #endif
24
- }
25
- }
26
- }