app.hypergames.hypersdk 1.4.13 → 1.4.14
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/CHANGELOG.md +8 -0
- package/Editor/Scripts/Setup/HyperSDKInstaller.cs +115 -16
- package/Editor/Scripts/Tools/HyperBuildAssistant.cs +4 -4
- package/HyperLoader.unity +3 -3
- package/Runtime/Internal/Managers/BackendManager.cs +106 -45
- package/Runtime/Internal/Managers/EventManager.cs +4 -0
- package/Runtime/Internal/Managers/GameManager.cs +36 -14
- package/Runtime/Internal/UI/Animation/SlideUp.cs +2 -2
- package/Runtime/Internal/UI/Modals/StartingInstructionModal.cs +76 -0
- package/Runtime/Resources/Fonts/Wonder Boys/Wonder Boys + Hyper BIG.mat +2 -2
- package/Runtime/Resources/Fonts/Wonder Boys/Wonder Boys + Shadows.mat +2 -2
- package/Runtime/Resources/Fonts/Wonder Boys/Wonder Boys.asset +1009 -311
- package/Runtime/Resources/UIPrefabs/SnackBar.prefab +3 -3
- package/package.json +1 -1
|
@@ -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
|
{
|
|
@@ -87,8 +87,8 @@ Material:
|
|
|
87
87
|
- _StencilOp: 0
|
|
88
88
|
- _StencilReadMask: 255
|
|
89
89
|
- _StencilWriteMask: 255
|
|
90
|
-
- _TextureHeight:
|
|
91
|
-
- _TextureWidth:
|
|
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:
|
|
91
|
-
- _TextureWidth:
|
|
90
|
+
- _TextureHeight: 512
|
|
91
|
+
- _TextureWidth: 512
|
|
92
92
|
- _UnderlayDilate: 0.05
|
|
93
93
|
- _UnderlayOffsetX: 0
|
|
94
94
|
- _UnderlayOffsetY: -1
|