com.puzzlescapegames.services 1.0.1 → 1.0.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.
- package/README.md +5 -1
- package/Runtime/Common/AudioMixer.mixer +146 -0
- package/Runtime/Common/AudioMixer.mixer.meta +8 -0
- package/Runtime/Common.meta +8 -0
- package/Runtime/Plugins/SlicedFilledImage.cs +730 -0
- package/Runtime/Plugins/SlicedFilledImage.cs.meta +11 -0
- package/Runtime/Plugins/UIGradient/Editor/UIGradientEditor.cs +218 -0
- package/Runtime/Plugins/UIGradient/Editor/UIGradientEditor.cs.meta +11 -0
- package/Runtime/Plugins/UIGradient/Editor/uigradient_inspector_icon.png +0 -0
- package/Runtime/Plugins/UIGradient/Editor/uigradient_inspector_icon.png.meta +110 -0
- package/Runtime/Plugins/UIGradient/Editor.meta +8 -0
- package/Runtime/Plugins/UIGradient/Scripts/UIGradient.cs +511 -0
- package/Runtime/Plugins/UIGradient/Scripts/UIGradient.cs.meta +11 -0
- package/Runtime/Plugins/UIGradient/Scripts/Vector2Extension.cs +24 -0
- package/Runtime/Plugins/UIGradient/Scripts/Vector2Extension.cs.meta +11 -0
- package/Runtime/Plugins/UIGradient/Scripts.meta +8 -0
- package/Runtime/Plugins/UIGradient.meta +8 -0
- package/Runtime/Plugins/Vibration/Vibration/Example/VibrationExample.cs +82 -0
- package/Runtime/Plugins/Vibration/Vibration/Example/VibrationExample.cs.meta +11 -0
- package/Runtime/Plugins/Vibration/Vibration/Example.meta +8 -0
- package/Runtime/Plugins/Vibration/Vibration/Vibration.cs +263 -0
- package/Runtime/Plugins/Vibration/Vibration/Vibration.cs.meta +12 -0
- package/Runtime/Plugins/Vibration/Vibration.asmdef +18 -0
- package/Runtime/Plugins/Vibration/Vibration.asmdef.meta +7 -0
- package/Runtime/Plugins/Vibration/Vibration.meta +8 -0
- package/Runtime/Plugins/Vibration/iOS/HapticFeedback.mm +64 -0
- package/Runtime/Plugins/Vibration/iOS/HapticFeedback.mm.meta +37 -0
- package/Runtime/Plugins/Vibration/iOS/Vibration.h +26 -0
- package/Runtime/Plugins/Vibration/iOS/Vibration.h.meta +27 -0
- package/Runtime/Plugins/Vibration/iOS/Vibration.mm +73 -0
- package/Runtime/Plugins/Vibration/iOS/Vibration.mm.meta +37 -0
- package/Runtime/Plugins/Vibration/iOS.meta +8 -0
- package/Runtime/Plugins/Vibration.meta +8 -0
- package/Runtime/Plugins.meta +8 -0
- package/Runtime/PuzzlescapeGames.Services.asmdef +20 -0
- package/Runtime/PuzzlescapeGames.Services.asmdef.meta +7 -0
- package/Runtime/Services/AudioService/AudioService.cs +82 -0
- package/Runtime/Services/AudioService/AudioService.cs.meta +3 -0
- package/Runtime/Services/AudioService/AudioServiceCustomInstaller.cs +29 -0
- package/Runtime/Services/AudioService/AudioServiceCustomInstaller.cs.meta +3 -0
- package/Runtime/Services/AudioService/AudioSource.cs +87 -0
- package/Runtime/Services/AudioService/AudioSource.cs.meta +3 -0
- package/Runtime/Services/AudioService/AudioSourceFactory.cs +6 -0
- package/Runtime/Services/AudioService/AudioSourceFactory.cs.meta +3 -0
- package/Runtime/Services/AudioService/IAudioService.cs +16 -0
- package/Runtime/Services/AudioService/IAudioService.cs.meta +3 -0
- package/Runtime/Services/AudioService.meta +8 -0
- package/Runtime/Services/NTPService/INTPService.cs +13 -0
- package/Runtime/Services/NTPService/INTPService.cs.meta +3 -0
- package/Runtime/Services/NTPService/NTPService.cs +153 -0
- package/Runtime/Services/NTPService/NTPService.cs.meta +3 -0
- package/Runtime/Services/NTPService/NTPServiceInstaller.cs +12 -0
- package/Runtime/Services/NTPService/NTPServiceInstaller.cs.meta +3 -0
- package/Runtime/Services/NTPService.meta +8 -0
- package/Runtime/Services/TickableService/TickableService.cs +29 -0
- package/Runtime/Services/TickableService/TickableService.cs.meta +3 -0
- package/Runtime/Services/TickableService/TickableServiceInstaller.cs +12 -0
- package/Runtime/Services/TickableService/TickableServiceInstaller.cs.meta +3 -0
- package/Runtime/Services/TickableService.meta +8 -0
- package/Runtime/Services/UIBlockingService/UIBlocker.cs +15 -0
- package/Runtime/Services/UIBlockingService/UIBlocker.cs.meta +3 -0
- package/Runtime/Services/UIBlockingService/UIBlockingService.cs +36 -0
- package/Runtime/Services/UIBlockingService/UIBlockingService.cs.meta +3 -0
- package/Runtime/Services/UIBlockingService/UIBlockingServiceInstaller.cs +17 -0
- package/Runtime/Services/UIBlockingService/UIBlockingServiceInstaller.cs.meta +3 -0
- package/Runtime/Services/UIBlockingService.meta +8 -0
- package/Runtime/Services/VibrationService/IVibrationService.cs +7 -0
- package/Runtime/Services/VibrationService/IVibrationService.cs.meta +3 -0
- package/Runtime/Services/VibrationService/VibrationService.cs +19 -0
- package/Runtime/Services/VibrationService/VibrationService.cs.meta +3 -0
- package/Runtime/Services/VibrationService/VibrationServiceInstaller.cs +12 -0
- package/Runtime/Services/VibrationService/VibrationServiceInstaller.cs.meta +3 -0
- package/Runtime/Services/VibrationService.meta +8 -0
- package/Runtime/Services.meta +8 -0
- package/package.json +1 -1
|
@@ -0,0 +1,263 @@
|
|
|
1
|
+
////////////////////////////////////////////////////////////////////////////////
|
|
2
|
+
//
|
|
3
|
+
// @author Benoît Freslon @benoitfreslon
|
|
4
|
+
// https://github.com/BenoitFreslon/Vibration
|
|
5
|
+
// https://benoitfreslon.com
|
|
6
|
+
//
|
|
7
|
+
////////////////////////////////////////////////////////////////////////////////
|
|
8
|
+
|
|
9
|
+
using System.Runtime.InteropServices.ComTypes;
|
|
10
|
+
using UnityEngine;
|
|
11
|
+
|
|
12
|
+
#if UNITY_IOS
|
|
13
|
+
using System.Collections;
|
|
14
|
+
using System.Runtime.InteropServices;
|
|
15
|
+
#endif
|
|
16
|
+
|
|
17
|
+
public static class Vibration
|
|
18
|
+
{
|
|
19
|
+
|
|
20
|
+
#if UNITY_IOS
|
|
21
|
+
[DllImport ( "__Internal" )]
|
|
22
|
+
private static extern bool _HasVibrator ();
|
|
23
|
+
|
|
24
|
+
[DllImport ( "__Internal" )]
|
|
25
|
+
private static extern void _Vibrate ();
|
|
26
|
+
|
|
27
|
+
[DllImport ( "__Internal" )]
|
|
28
|
+
private static extern void _VibratePop ();
|
|
29
|
+
|
|
30
|
+
[DllImport ( "__Internal" )]
|
|
31
|
+
private static extern void _VibratePeek ();
|
|
32
|
+
|
|
33
|
+
[DllImport ( "__Internal" )]
|
|
34
|
+
private static extern void _VibrateNope ();
|
|
35
|
+
|
|
36
|
+
[DllImport("__Internal")]
|
|
37
|
+
private static extern void _impactOccurred(string style);
|
|
38
|
+
|
|
39
|
+
[DllImport("__Internal")]
|
|
40
|
+
private static extern void _notificationOccurred(string style);
|
|
41
|
+
|
|
42
|
+
[DllImport("__Internal")]
|
|
43
|
+
private static extern void _selectionChanged();
|
|
44
|
+
#endif
|
|
45
|
+
|
|
46
|
+
#if UNITY_ANDROID
|
|
47
|
+
public static AndroidJavaClass unityPlayer;
|
|
48
|
+
public static AndroidJavaObject currentActivity;
|
|
49
|
+
public static AndroidJavaObject vibrator;
|
|
50
|
+
public static AndroidJavaObject context;
|
|
51
|
+
|
|
52
|
+
public static AndroidJavaClass vibrationEffect;
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
#endif
|
|
56
|
+
|
|
57
|
+
private static bool initialized = false;
|
|
58
|
+
public static void Init ()
|
|
59
|
+
{
|
|
60
|
+
if ( initialized ) return;
|
|
61
|
+
|
|
62
|
+
#if UNITY_ANDROID
|
|
63
|
+
|
|
64
|
+
if ( Application.isMobilePlatform ) {
|
|
65
|
+
|
|
66
|
+
unityPlayer = new AndroidJavaClass ( "com.unity3d.player.UnityPlayer" );
|
|
67
|
+
currentActivity = unityPlayer.GetStatic<AndroidJavaObject> ( "currentActivity" );
|
|
68
|
+
vibrator = currentActivity.Call<AndroidJavaObject> ( "getSystemService", "vibrator" );
|
|
69
|
+
context = currentActivity.Call<AndroidJavaObject> ( "getApplicationContext" );
|
|
70
|
+
|
|
71
|
+
if ( AndroidVersion >= 26 ) {
|
|
72
|
+
vibrationEffect = new AndroidJavaClass ( "android.os.VibrationEffect" );
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
}
|
|
76
|
+
#endif
|
|
77
|
+
|
|
78
|
+
initialized = true;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
public static void VibrateIOS(ImpactFeedbackStyle style)
|
|
83
|
+
{
|
|
84
|
+
#if UNITY_IOS
|
|
85
|
+
_impactOccurred(style.ToString());
|
|
86
|
+
#endif
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
public static void VibrateIOS(NotificationFeedbackStyle style)
|
|
90
|
+
{
|
|
91
|
+
#if UNITY_IOS
|
|
92
|
+
_notificationOccurred(style.ToString());
|
|
93
|
+
#endif
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
public static void VibrateIOS_SelectionChanged()
|
|
97
|
+
|
|
98
|
+
{
|
|
99
|
+
#if UNITY_IOS
|
|
100
|
+
_selectionChanged();
|
|
101
|
+
#endif
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
///<summary>
|
|
108
|
+
/// Tiny pop vibration
|
|
109
|
+
///</summary>
|
|
110
|
+
public static void VibratePop ()
|
|
111
|
+
{
|
|
112
|
+
if ( Application.isMobilePlatform ) {
|
|
113
|
+
#if UNITY_IOS
|
|
114
|
+
_VibratePop ();
|
|
115
|
+
#elif UNITY_ANDROID
|
|
116
|
+
VibrateAndroid ( 50 );
|
|
117
|
+
#endif
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
///<summary>
|
|
121
|
+
/// Small peek vibration
|
|
122
|
+
///</summary>
|
|
123
|
+
public static void VibratePeek ()
|
|
124
|
+
{
|
|
125
|
+
if ( Application.isMobilePlatform ) {
|
|
126
|
+
#if UNITY_IOS
|
|
127
|
+
_VibratePeek ();
|
|
128
|
+
#elif UNITY_ANDROID
|
|
129
|
+
VibrateAndroid ( 100 );
|
|
130
|
+
#endif
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
///<summary>
|
|
134
|
+
/// 3 small vibrations
|
|
135
|
+
///</summary>
|
|
136
|
+
public static void VibrateNope ()
|
|
137
|
+
{
|
|
138
|
+
if ( Application.isMobilePlatform ) {
|
|
139
|
+
#if UNITY_IOS
|
|
140
|
+
_VibrateNope ();
|
|
141
|
+
#elif UNITY_ANDROID
|
|
142
|
+
long[] pattern = { 0, 50, 50, 50 };
|
|
143
|
+
VibrateAndroid ( pattern, -1 );
|
|
144
|
+
#endif
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
#if UNITY_ANDROID
|
|
150
|
+
///<summary>
|
|
151
|
+
/// Only on Android
|
|
152
|
+
/// https://developer.android.com/reference/android/os/Vibrator.html#vibrate(long)
|
|
153
|
+
///</summary>
|
|
154
|
+
public static void VibrateAndroid ( long milliseconds )
|
|
155
|
+
{
|
|
156
|
+
|
|
157
|
+
if ( Application.isMobilePlatform ) {
|
|
158
|
+
if ( AndroidVersion >= 26 ) {
|
|
159
|
+
AndroidJavaObject createOneShot = vibrationEffect.CallStatic<AndroidJavaObject> ( "createOneShot", milliseconds, -1 );
|
|
160
|
+
vibrator.Call ( "vibrate", createOneShot );
|
|
161
|
+
|
|
162
|
+
} else {
|
|
163
|
+
vibrator.Call ( "vibrate", milliseconds );
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
///<summary>
|
|
169
|
+
/// Only on Android
|
|
170
|
+
/// https://proandroiddev.com/using-vibrate-in-android-b0e3ef5d5e07
|
|
171
|
+
///</summary>
|
|
172
|
+
public static void VibrateAndroid ( long[] pattern, int repeat )
|
|
173
|
+
{
|
|
174
|
+
if ( Application.isMobilePlatform ) {
|
|
175
|
+
if ( AndroidVersion >= 26 ) {
|
|
176
|
+
long[] amplitudes;
|
|
177
|
+
AndroidJavaObject createWaveform = vibrationEffect.CallStatic<AndroidJavaObject> ( "createWaveform", pattern, repeat );
|
|
178
|
+
vibrator.Call ( "vibrate", createWaveform );
|
|
179
|
+
|
|
180
|
+
} else {
|
|
181
|
+
vibrator.Call ( "vibrate", pattern, repeat );
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
#endif
|
|
186
|
+
|
|
187
|
+
///<summary>
|
|
188
|
+
///Only on Android
|
|
189
|
+
///</summary>
|
|
190
|
+
public static void CancelAndroid ()
|
|
191
|
+
{
|
|
192
|
+
if ( Application.isMobilePlatform ) {
|
|
193
|
+
#if UNITY_ANDROID
|
|
194
|
+
vibrator.Call ( "cancel" );
|
|
195
|
+
#endif
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
public static bool HasVibrator ()
|
|
200
|
+
{
|
|
201
|
+
if ( Application.isMobilePlatform ) {
|
|
202
|
+
|
|
203
|
+
#if UNITY_ANDROID
|
|
204
|
+
|
|
205
|
+
AndroidJavaClass contextClass = new AndroidJavaClass ( "android.content.Context" );
|
|
206
|
+
string Context_VIBRATOR_SERVICE = contextClass.GetStatic<string> ( "VIBRATOR_SERVICE" );
|
|
207
|
+
AndroidJavaObject systemService = context.Call<AndroidJavaObject> ( "getSystemService", Context_VIBRATOR_SERVICE );
|
|
208
|
+
if ( systemService.Call<bool> ( "hasVibrator" ) ) {
|
|
209
|
+
return true;
|
|
210
|
+
} else {
|
|
211
|
+
return false;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
#elif UNITY_IOS
|
|
215
|
+
return _HasVibrator ();
|
|
216
|
+
#else
|
|
217
|
+
return false;
|
|
218
|
+
#endif
|
|
219
|
+
} else {
|
|
220
|
+
return false;
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
|
|
225
|
+
public static void Vibrate ()
|
|
226
|
+
{
|
|
227
|
+
#if UNITY_ANDROID || UNITY_IOS
|
|
228
|
+
|
|
229
|
+
if ( Application.isMobilePlatform ) {
|
|
230
|
+
Handheld.Vibrate ();
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
#endif
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
public static int AndroidVersion {
|
|
237
|
+
get {
|
|
238
|
+
int iVersionNumber = 0;
|
|
239
|
+
if ( Application.platform == RuntimePlatform.Android ) {
|
|
240
|
+
string androidVersion = SystemInfo.operatingSystem;
|
|
241
|
+
int sdkPos = androidVersion.IndexOf ( "API-" );
|
|
242
|
+
iVersionNumber = int.Parse ( androidVersion.Substring ( sdkPos + 4, 2 ).ToString () );
|
|
243
|
+
}
|
|
244
|
+
return iVersionNumber;
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
public enum ImpactFeedbackStyle
|
|
250
|
+
{
|
|
251
|
+
Heavy,
|
|
252
|
+
Medium,
|
|
253
|
+
Light,
|
|
254
|
+
Rigid,
|
|
255
|
+
Soft
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
public enum NotificationFeedbackStyle
|
|
259
|
+
{
|
|
260
|
+
Error,
|
|
261
|
+
Success,
|
|
262
|
+
Warning
|
|
263
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
fileFormatVersion: 2
|
|
2
|
+
guid: 9a1817bb553014d4c9a665d4fa202202
|
|
3
|
+
timeCreated: 1474899097
|
|
4
|
+
licenseType: Pro
|
|
5
|
+
MonoImporter:
|
|
6
|
+
serializedVersion: 2
|
|
7
|
+
defaultReferences: []
|
|
8
|
+
executionOrder: 0
|
|
9
|
+
icon: {instanceID: 0}
|
|
10
|
+
userData:
|
|
11
|
+
assetBundleName:
|
|
12
|
+
assetBundleVariant:
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "Vibration",
|
|
3
|
+
"rootNamespace": "",
|
|
4
|
+
"references": [],
|
|
5
|
+
"includePlatforms": [
|
|
6
|
+
"Android",
|
|
7
|
+
"Editor",
|
|
8
|
+
"iOS"
|
|
9
|
+
],
|
|
10
|
+
"excludePlatforms": [],
|
|
11
|
+
"allowUnsafeCode": false,
|
|
12
|
+
"overrideReferences": false,
|
|
13
|
+
"precompiledReferences": [],
|
|
14
|
+
"autoReferenced": true,
|
|
15
|
+
"defineConstraints": [],
|
|
16
|
+
"versionDefines": [],
|
|
17
|
+
"noEngineReferences": false
|
|
18
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
#import <UIKit/UIKit.h>
|
|
2
|
+
|
|
3
|
+
extern "C" {
|
|
4
|
+
|
|
5
|
+
void _impactOccurred(const char *style)
|
|
6
|
+
{
|
|
7
|
+
|
|
8
|
+
UIImpactFeedbackStyle feedbackStyle;
|
|
9
|
+
if (strcmp(style, "Heavy") == 0)
|
|
10
|
+
feedbackStyle = UIImpactFeedbackStyleHeavy;
|
|
11
|
+
else if (strcmp(style, "Medium") == 0)
|
|
12
|
+
feedbackStyle = UIImpactFeedbackStyleMedium;
|
|
13
|
+
else if (strcmp(style, "Light") == 0)
|
|
14
|
+
feedbackStyle = UIImpactFeedbackStyleLight;
|
|
15
|
+
else if (strcmp(style, "Rigid") == 0)
|
|
16
|
+
if (@available(iOS 13.0, *)) {
|
|
17
|
+
feedbackStyle = UIImpactFeedbackStyleRigid;
|
|
18
|
+
} else {
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
else if (strcmp(style, "Soft") == 0)
|
|
22
|
+
if (@available(iOS 13.0, *)) {
|
|
23
|
+
feedbackStyle = UIImpactFeedbackStyleSoft;
|
|
24
|
+
} else {
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
else
|
|
28
|
+
return;
|
|
29
|
+
|
|
30
|
+
UIImpactFeedbackGenerator *generator = [[UIImpactFeedbackGenerator alloc] initWithStyle:feedbackStyle];
|
|
31
|
+
|
|
32
|
+
[generator prepare];
|
|
33
|
+
|
|
34
|
+
[generator impactOccurred];
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
void _notificationOccurred(const char *style)
|
|
38
|
+
{
|
|
39
|
+
UINotificationFeedbackType feedbackStyle;
|
|
40
|
+
if (strcmp(style, "Error") == 0)
|
|
41
|
+
feedbackStyle = UINotificationFeedbackTypeError;
|
|
42
|
+
else if (strcmp(style, "Success") == 0)
|
|
43
|
+
feedbackStyle = UINotificationFeedbackTypeSuccess;
|
|
44
|
+
else if (strcmp(style, "Warning") == 0)
|
|
45
|
+
feedbackStyle = UINotificationFeedbackTypeWarning;
|
|
46
|
+
else
|
|
47
|
+
return;
|
|
48
|
+
|
|
49
|
+
UINotificationFeedbackGenerator *generator = [[UINotificationFeedbackGenerator alloc] init];
|
|
50
|
+
|
|
51
|
+
[generator prepare];
|
|
52
|
+
|
|
53
|
+
[generator notificationOccurred:feedbackStyle];
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
void _selectionChanged()
|
|
57
|
+
{
|
|
58
|
+
UISelectionFeedbackGenerator *generator = [[UISelectionFeedbackGenerator alloc] init];
|
|
59
|
+
|
|
60
|
+
[generator prepare];
|
|
61
|
+
|
|
62
|
+
[generator selectionChanged];
|
|
63
|
+
}
|
|
64
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
fileFormatVersion: 2
|
|
2
|
+
guid: 077b20d7b7a7dc14aafdb8363888b849
|
|
3
|
+
PluginImporter:
|
|
4
|
+
externalObjects: {}
|
|
5
|
+
serializedVersion: 2
|
|
6
|
+
iconMap: {}
|
|
7
|
+
executionOrder: {}
|
|
8
|
+
defineConstraints: []
|
|
9
|
+
isPreloaded: 0
|
|
10
|
+
isOverridable: 0
|
|
11
|
+
isExplicitlyReferenced: 0
|
|
12
|
+
validateReferences: 1
|
|
13
|
+
platformData:
|
|
14
|
+
- first:
|
|
15
|
+
Any:
|
|
16
|
+
second:
|
|
17
|
+
enabled: 0
|
|
18
|
+
settings: {}
|
|
19
|
+
- first:
|
|
20
|
+
Editor: Editor
|
|
21
|
+
second:
|
|
22
|
+
enabled: 0
|
|
23
|
+
settings:
|
|
24
|
+
DefaultValueInitialized: true
|
|
25
|
+
- first:
|
|
26
|
+
iPhone: iOS
|
|
27
|
+
second:
|
|
28
|
+
enabled: 1
|
|
29
|
+
settings: {}
|
|
30
|
+
- first:
|
|
31
|
+
tvOS: tvOS
|
|
32
|
+
second:
|
|
33
|
+
enabled: 1
|
|
34
|
+
settings: {}
|
|
35
|
+
userData:
|
|
36
|
+
assetBundleName:
|
|
37
|
+
assetBundleVariant:
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Vibration.h
|
|
3
|
+
// https://videogamecreation.fr
|
|
4
|
+
//
|
|
5
|
+
// Created by Benoît Freslon on 23/03/2017.
|
|
6
|
+
// Copyright © 2018 Benoît Freslon. All rights reserved.
|
|
7
|
+
//
|
|
8
|
+
#import <Foundation/Foundation.h>
|
|
9
|
+
|
|
10
|
+
@interface Vibration : NSObject
|
|
11
|
+
|
|
12
|
+
//////////////////////////////////////////
|
|
13
|
+
|
|
14
|
+
#pragma mark - Vibrate
|
|
15
|
+
|
|
16
|
+
+ (BOOL) hasVibrator;
|
|
17
|
+
+ (void) vibrate;
|
|
18
|
+
+ (void) vibratePeek;
|
|
19
|
+
+ (void) vibratePop;
|
|
20
|
+
+ (void) vibrateNope;
|
|
21
|
+
|
|
22
|
+
//////////////////////////////////////////
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
@end
|
|
26
|
+
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
fileFormatVersion: 2
|
|
2
|
+
guid: 83a187def68af42c29e1a38e747ea79a
|
|
3
|
+
PluginImporter:
|
|
4
|
+
externalObjects: {}
|
|
5
|
+
serializedVersion: 2
|
|
6
|
+
iconMap: {}
|
|
7
|
+
executionOrder: {}
|
|
8
|
+
defineConstraints: []
|
|
9
|
+
isPreloaded: 0
|
|
10
|
+
isOverridable: 0
|
|
11
|
+
isExplicitlyReferenced: 0
|
|
12
|
+
validateReferences: 1
|
|
13
|
+
platformData:
|
|
14
|
+
- first:
|
|
15
|
+
Any:
|
|
16
|
+
second:
|
|
17
|
+
enabled: 1
|
|
18
|
+
settings: {}
|
|
19
|
+
- first:
|
|
20
|
+
Editor: Editor
|
|
21
|
+
second:
|
|
22
|
+
enabled: 0
|
|
23
|
+
settings:
|
|
24
|
+
DefaultValueInitialized: true
|
|
25
|
+
userData:
|
|
26
|
+
assetBundleName:
|
|
27
|
+
assetBundleVariant:
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Vibration.mm
|
|
3
|
+
// https://videogamecreation.fr
|
|
4
|
+
//
|
|
5
|
+
// Created by Benoît Freslon on 23/03/2017.
|
|
6
|
+
// Copyright © 2018 Benoît Freslon. All rights reserved.
|
|
7
|
+
//
|
|
8
|
+
#import <Foundation/Foundation.h>
|
|
9
|
+
#import <AudioToolbox/AudioToolbox.h>
|
|
10
|
+
#import <UIKit/UIKit.h>
|
|
11
|
+
|
|
12
|
+
#import "Vibration.h"
|
|
13
|
+
|
|
14
|
+
#define USING_IPAD UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad
|
|
15
|
+
|
|
16
|
+
@interface Vibration ()
|
|
17
|
+
|
|
18
|
+
@end
|
|
19
|
+
|
|
20
|
+
@implementation Vibration
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
//////////////////////////////////////////
|
|
25
|
+
|
|
26
|
+
#pragma mark - Vibrate
|
|
27
|
+
|
|
28
|
+
+ (BOOL) hasVibrator {
|
|
29
|
+
return !(USING_IPAD);
|
|
30
|
+
}
|
|
31
|
+
+ (void) vibrate {
|
|
32
|
+
AudioServicesPlaySystemSoundWithCompletion(1352, NULL);
|
|
33
|
+
}
|
|
34
|
+
+ (void) vibratePeek {
|
|
35
|
+
AudioServicesPlaySystemSoundWithCompletion(1519, NULL); // Actuate `Peek` feedback (weak boom)
|
|
36
|
+
}
|
|
37
|
+
+ (void) vibratePop {
|
|
38
|
+
AudioServicesPlaySystemSoundWithCompletion(1520, NULL); // Actuate `Pop` feedback (strong boom)
|
|
39
|
+
}
|
|
40
|
+
+ (void) vibrateNope {
|
|
41
|
+
AudioServicesPlaySystemSoundWithCompletion(1521, NULL); // Actuate `Nope` feedback (series of three weak booms)
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
@end
|
|
45
|
+
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
46
|
+
|
|
47
|
+
#pragma mark - "C"
|
|
48
|
+
|
|
49
|
+
extern "C" {
|
|
50
|
+
|
|
51
|
+
//////////////////////////////////////////
|
|
52
|
+
// Vibrate
|
|
53
|
+
|
|
54
|
+
bool _HasVibrator () {
|
|
55
|
+
return [Vibration hasVibrator];
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
void _Vibrate () {
|
|
59
|
+
[Vibration vibrate];
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
void _VibratePeek () {
|
|
63
|
+
[Vibration vibratePeek];
|
|
64
|
+
}
|
|
65
|
+
void _VibratePop () {
|
|
66
|
+
[Vibration vibratePop];
|
|
67
|
+
}
|
|
68
|
+
void _VibrateNope () {
|
|
69
|
+
[Vibration vibrateNope];
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
}
|
|
73
|
+
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
fileFormatVersion: 2
|
|
2
|
+
guid: c31160a40d8f84d4395a22df26febd41
|
|
3
|
+
PluginImporter:
|
|
4
|
+
externalObjects: {}
|
|
5
|
+
serializedVersion: 2
|
|
6
|
+
iconMap: {}
|
|
7
|
+
executionOrder: {}
|
|
8
|
+
defineConstraints: []
|
|
9
|
+
isPreloaded: 0
|
|
10
|
+
isOverridable: 0
|
|
11
|
+
isExplicitlyReferenced: 0
|
|
12
|
+
validateReferences: 1
|
|
13
|
+
platformData:
|
|
14
|
+
- first:
|
|
15
|
+
Any:
|
|
16
|
+
second:
|
|
17
|
+
enabled: 0
|
|
18
|
+
settings: {}
|
|
19
|
+
- first:
|
|
20
|
+
Editor: Editor
|
|
21
|
+
second:
|
|
22
|
+
enabled: 0
|
|
23
|
+
settings:
|
|
24
|
+
DefaultValueInitialized: true
|
|
25
|
+
- first:
|
|
26
|
+
iPhone: iOS
|
|
27
|
+
second:
|
|
28
|
+
enabled: 1
|
|
29
|
+
settings: {}
|
|
30
|
+
- first:
|
|
31
|
+
tvOS: tvOS
|
|
32
|
+
second:
|
|
33
|
+
enabled: 1
|
|
34
|
+
settings: {}
|
|
35
|
+
userData:
|
|
36
|
+
assetBundleName:
|
|
37
|
+
assetBundleVariant:
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "PuzzlescapeGames.Services",
|
|
3
|
+
"rootNamespace": "",
|
|
4
|
+
"references": [
|
|
5
|
+
"GUID:1de137006ee9ba0498bfecb3f78298e2",
|
|
6
|
+
"GUID:9e5f34ba0cc07fc4184cb3bf9d5c4b7e",
|
|
7
|
+
"GUID:0d8beb7f090555447a6cf5ce9e54dbb4",
|
|
8
|
+
"GUID:f51ebe6a0ceec4240a699833d6309b23",
|
|
9
|
+
"GUID:0c0c8357443d62a4c9e55fe39d3a3e51"
|
|
10
|
+
],
|
|
11
|
+
"includePlatforms": [],
|
|
12
|
+
"excludePlatforms": [],
|
|
13
|
+
"allowUnsafeCode": false,
|
|
14
|
+
"overrideReferences": false,
|
|
15
|
+
"precompiledReferences": [],
|
|
16
|
+
"autoReferenced": true,
|
|
17
|
+
"defineConstraints": [],
|
|
18
|
+
"versionDefines": [],
|
|
19
|
+
"noEngineReferences": false
|
|
20
|
+
}
|