app.hypergames.hypersdk 1.4.13 → 1.4.15

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.
@@ -5,6 +5,10 @@ using TMPro;
5
5
  using UnityEngine;
6
6
  using UnityEngine.UI;
7
7
 
8
+ #if ENABLE_INPUT_SYSTEM
9
+ using UnityEngine.InputSystem;
10
+ #endif
11
+
8
12
  namespace Hyper.Internal
9
13
  {
10
14
  internal class StartingInstructionModal : MonoBehaviour
@@ -93,6 +97,8 @@ namespace Hyper.Internal
93
97
  {
94
98
  bool tapDetected = false;
95
99
 
100
+ #if ENABLE_LEGACY_INPUT_MANAGER
101
+ // Old Input System
96
102
  // Check mouse input (works in editor and desktop)
97
103
  if (Input.GetMouseButtonDown(0))
98
104
  {
@@ -108,6 +114,20 @@ namespace Hyper.Internal
108
114
  tapDetected = true;
109
115
  }
110
116
  }
117
+ #elif ENABLE_INPUT_SYSTEM
118
+ // New Input System
119
+ // Check mouse input (works in editor and desktop)
120
+ if (Mouse.current != null && Mouse.current.leftButton.wasPressedThisFrame)
121
+ {
122
+ tapDetected = true;
123
+ }
124
+
125
+ // Check touch input (works on mobile and WebGL)
126
+ if (Touchscreen.current != null && Touchscreen.current.primaryTouch.press.wasPressedThisFrame)
127
+ {
128
+ tapDetected = true;
129
+ }
130
+ #endif
111
131
 
112
132
  if (tapDetected)
113
133
  {
@@ -123,6 +143,8 @@ namespace Hyper.Internal
123
143
  bool swipeDetected = false;
124
144
  Vector2 currentPosition = Vector2.zero;
125
145
 
146
+ #if ENABLE_LEGACY_INPUT_MANAGER
147
+ // Old Input System
126
148
  // Check mouse input (works in editor and desktop)
127
149
  if (Input.GetMouseButtonDown(0))
128
150
  {
@@ -171,6 +193,60 @@ namespace Hyper.Internal
171
193
  _isTrackingSwipe = false;
172
194
  }
173
195
  }
196
+ #elif ENABLE_INPUT_SYSTEM
197
+ // New Input System
198
+ // Check mouse input (works in editor and desktop)
199
+ if (Mouse.current != null)
200
+ {
201
+ if (Mouse.current.leftButton.wasPressedThisFrame)
202
+ {
203
+ _swipeStartPosition = Mouse.current.position.ReadValue();
204
+ _isTrackingSwipe = true;
205
+ }
206
+ else if (Mouse.current.leftButton.isPressed && _isTrackingSwipe)
207
+ {
208
+ currentPosition = Mouse.current.position.ReadValue();
209
+ Vector2 delta = currentPosition - _swipeStartPosition;
210
+
211
+ if (IsSwipeDirectionValid(delta))
212
+ {
213
+ swipeDetected = true;
214
+ _isTrackingSwipe = false;
215
+ }
216
+ }
217
+ else if (Mouse.current.leftButton.wasReleasedThisFrame)
218
+ {
219
+ _isTrackingSwipe = false;
220
+ }
221
+ }
222
+
223
+ // Check touch input (works on mobile and WebGL)
224
+ if (Touchscreen.current != null)
225
+ {
226
+ var touch = Touchscreen.current.primaryTouch;
227
+
228
+ if (touch.press.wasPressedThisFrame)
229
+ {
230
+ _swipeStartPosition = touch.position.ReadValue();
231
+ _isTrackingSwipe = true;
232
+ }
233
+ else if (touch.press.isPressed && _isTrackingSwipe)
234
+ {
235
+ currentPosition = touch.position.ReadValue();
236
+ Vector2 delta = currentPosition - _swipeStartPosition;
237
+
238
+ if (IsSwipeDirectionValid(delta))
239
+ {
240
+ swipeDetected = true;
241
+ _isTrackingSwipe = false;
242
+ }
243
+ }
244
+ else if (touch.press.wasReleasedThisFrame)
245
+ {
246
+ _isTrackingSwipe = false;
247
+ }
248
+ }
249
+ #endif
174
250
 
175
251
  if (swipeDetected)
176
252
  {
@@ -0,0 +1,21 @@
1
+ fileFormatVersion: 2
2
+ guid: 710a89ea28c54bc4784ad1647aabd91a
3
+ TrueTypeFontImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 4
6
+ fontSize: 16
7
+ forceTextureCase: -2
8
+ characterSpacing: 0
9
+ characterPadding: 1
10
+ includeFontData: 1
11
+ fontNames:
12
+ - Nunito
13
+ fallbackFontReferences: []
14
+ customCharacters:
15
+ fontRenderingMode: 0
16
+ ascentCalculationMode: 1
17
+ useLegacyBoundsCalculation: 0
18
+ shouldRoundAdvanceValue: 1
19
+ userData:
20
+ assetBundleName:
21
+ assetBundleVariant:
@@ -0,0 +1,21 @@
1
+ fileFormatVersion: 2
2
+ guid: b30ebda8abeab9141b81300eece30fe0
3
+ TrueTypeFontImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 4
6
+ fontSize: 16
7
+ forceTextureCase: -2
8
+ characterSpacing: 0
9
+ characterPadding: 1
10
+ includeFontData: 1
11
+ fontNames:
12
+ - Nunito
13
+ fallbackFontReferences: []
14
+ customCharacters:
15
+ fontRenderingMode: 0
16
+ ascentCalculationMode: 1
17
+ useLegacyBoundsCalculation: 0
18
+ shouldRoundAdvanceValue: 1
19
+ userData:
20
+ assetBundleName:
21
+ assetBundleVariant:
@@ -87,8 +87,8 @@ Material:
87
87
  - _StencilOp: 0
88
88
  - _StencilReadMask: 255
89
89
  - _StencilWriteMask: 255
90
- - _TextureHeight: 256
91
- - _TextureWidth: 256
90
+ - _TextureHeight: 512
91
+ - _TextureWidth: 512
92
92
  - _UnderlayDilate: 1
93
93
  - _UnderlayOffsetX: 0
94
94
  - _UnderlayOffsetY: -0.85
@@ -87,8 +87,8 @@ Material:
87
87
  - _StencilOp: 0
88
88
  - _StencilReadMask: 255
89
89
  - _StencilWriteMask: 255
90
- - _TextureHeight: 256
91
- - _TextureWidth: 256
90
+ - _TextureHeight: 512
91
+ - _TextureWidth: 512
92
92
  - _UnderlayDilate: 0.05
93
93
  - _UnderlayOffsetX: 0
94
94
  - _UnderlayOffsetY: -1