app.hypergames.hypersdk 1.4.10 → 1.4.12
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 +14 -0
- package/HyperLoader.unity +3 -3
- package/Runtime/Internal/Managers/BackendManager.cs +88 -10
- package/Runtime/Internal/Managers/GameManager.cs +42 -0
- package/Runtime/Internal/Managers/TimeManager.cs +14 -5
- package/Runtime/Internal/UI/Components/ConnectionStatusIcon.cs +2 -10
- package/Runtime/Internal/UI/Modals/GamePausedModal.cs +1 -1
- package/Runtime/Internal/UI/Modals/TutorialLoaderModal.cs +1 -1
- package/Runtime/Plugins/WebGL/HyperCorePlugin.jslib +9 -8
- package/Runtime/Plugins/WebGL/HyperWebSocketPlugin.jslib +0 -1
- package/Runtime/Resources/UIPrefabs/ControlBar.prefab +110 -20
- package/Runtime/Resources/UIPrefabs/TutorialLandscapeModal.prefab +1 -1
- package/Runtime/Resources/UIPrefabs/TutorialPortraitModal.prefab +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
## [1.4.12](https://github.com/mvmhyper/hyper-sdk/compare/v1.4.11...v1.4.12) (2025-12-23)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* Improve session reliability and security handling in HyperSDK ([e39ed3e](https://github.com/mvmhyper/hyper-sdk/commit/e39ed3e2beccc271b0aaf5bf27c9c1a6ba6e6c92))
|
|
7
|
+
|
|
8
|
+
## [1.4.11](https://github.com/mvmhyper/hyper-sdk/compare/v1.4.10...v1.4.11) (2025-12-20)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* bug fixes and reliability improvements ([4bc454b](https://github.com/mvmhyper/hyper-sdk/commit/4bc454b08dd61ae3300ab2272eac31789e81d3d0))
|
|
14
|
+
|
|
1
15
|
## [1.4.10](https://github.com/mvmhyper/hyper-sdk/compare/v1.4.9...v1.4.10) (2025-12-16)
|
|
2
16
|
|
|
3
17
|
|
package/HyperLoader.unity
CHANGED
|
@@ -304,7 +304,7 @@ RectTransform:
|
|
|
304
304
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
|
305
305
|
m_AnchorMin: {x: 0, y: 1}
|
|
306
306
|
m_AnchorMax: {x: 0, y: 1}
|
|
307
|
-
m_AnchoredPosition: {x: 489.
|
|
307
|
+
m_AnchoredPosition: {x: 489.112, y: -280.1698}
|
|
308
308
|
m_SizeDelta: {x: 1044.9, y: 239.347}
|
|
309
309
|
m_Pivot: {x: 0.5, y: 0.5}
|
|
310
310
|
--- !u!114 &751153944
|
|
@@ -840,7 +840,7 @@ GameObject:
|
|
|
840
840
|
m_Component:
|
|
841
841
|
- component: {fileID: 1064166296}
|
|
842
842
|
m_Layer: 0
|
|
843
|
-
m_Name:
|
|
843
|
+
m_Name: __HyperSDK_BuildMarker_639020542296075009
|
|
844
844
|
m_TagString: Untagged
|
|
845
845
|
m_Icon: {fileID: 0}
|
|
846
846
|
m_NavMeshLayer: 0
|
|
@@ -1092,7 +1092,7 @@ RectTransform:
|
|
|
1092
1092
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
|
1093
1093
|
m_AnchorMin: {x: 0, y: 1}
|
|
1094
1094
|
m_AnchorMax: {x: 0, y: 1}
|
|
1095
|
-
m_AnchoredPosition: {x: 489.
|
|
1095
|
+
m_AnchoredPosition: {x: 489.112, y: -133.2274}
|
|
1096
1096
|
m_SizeDelta: {x: 875, y: 54.5378}
|
|
1097
1097
|
m_Pivot: {x: 0.5, y: 0.5}
|
|
1098
1098
|
--- !u!1 &2874543288936963705
|
|
@@ -269,7 +269,9 @@ namespace Hyper.Internal.Managers
|
|
|
269
269
|
|
|
270
270
|
private Coroutine _initWebSocketCoroutine;
|
|
271
271
|
private Coroutine _sendGameStartedCoroutine;
|
|
272
|
+
private Coroutine _sendGameResumedCoroutine;
|
|
272
273
|
private bool _gameStarted;
|
|
274
|
+
private bool _gameResumed;
|
|
273
275
|
private bool _isManuallyClosed;
|
|
274
276
|
private bool _isSocketErrorCalled;
|
|
275
277
|
|
|
@@ -334,18 +336,63 @@ namespace Hyper.Internal.Managers
|
|
|
334
336
|
|
|
335
337
|
public void SendGameResumed()
|
|
336
338
|
{
|
|
337
|
-
|
|
339
|
+
if (_sendGameResumedCoroutine == null)
|
|
338
340
|
{
|
|
339
|
-
|
|
340
|
-
|
|
341
|
+
_sendGameResumedCoroutine = StartCoroutine(SendGameResumedCoroutine());
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
private IEnumerator SendGameResumedCoroutine()
|
|
346
|
+
{
|
|
347
|
+
int attempts = 0;
|
|
348
|
+
const int maxAttempts = 3;
|
|
349
|
+
|
|
350
|
+
if (string.IsNullOrEmpty(_cachedSessionId))
|
|
351
|
+
{
|
|
352
|
+
HyperDebug.LogError("No valid session ID – cannot send resumeGame");
|
|
353
|
+
_sendGameResumedCoroutine = null;
|
|
354
|
+
yield break;
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
_gameResumed = false;
|
|
358
|
+
|
|
359
|
+
while (!_gameResumed && attempts < maxAttempts)
|
|
360
|
+
{
|
|
361
|
+
attempts++;
|
|
362
|
+
|
|
363
|
+
try
|
|
341
364
|
{
|
|
342
|
-
|
|
343
|
-
|
|
365
|
+
var message = new
|
|
366
|
+
{
|
|
367
|
+
@event = "resumeGame",
|
|
368
|
+
data = new
|
|
369
|
+
{
|
|
370
|
+
sessionId = _cachedSessionId,
|
|
371
|
+
userId = _gameManager?.Config.UserId
|
|
372
|
+
}
|
|
373
|
+
};
|
|
374
|
+
|
|
375
|
+
string json = JsonConvert.SerializeObject(message);
|
|
376
|
+
SendWebSocketMessage(json);
|
|
344
377
|
}
|
|
345
|
-
|
|
378
|
+
catch (Exception ex)
|
|
379
|
+
{
|
|
380
|
+
HyperDebug.LogError($"SendGameResumed attempt {attempts} failed: {ex.Message}");
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
float elapsed = 0f;
|
|
384
|
+
const float timeout = 2f;
|
|
346
385
|
|
|
347
|
-
|
|
348
|
-
|
|
386
|
+
while (!_gameResumed && elapsed < timeout)
|
|
387
|
+
{
|
|
388
|
+
yield return null;
|
|
389
|
+
elapsed += Time.unscaledDeltaTime;
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
yield return new WaitForSecondsRealtime(2f);
|
|
394
|
+
|
|
395
|
+
_sendGameResumedCoroutine = null;
|
|
349
396
|
}
|
|
350
397
|
|
|
351
398
|
private IEnumerator SendGameStartedCoroutine()
|
|
@@ -356,6 +403,7 @@ namespace Hyper.Internal.Managers
|
|
|
356
403
|
if (string.IsNullOrEmpty(_cachedSessionId))
|
|
357
404
|
{
|
|
358
405
|
HyperDebug.LogError("No valid session ID – cannot send startGame");
|
|
406
|
+
_sendGameStartedCoroutine = null;
|
|
359
407
|
yield break;
|
|
360
408
|
}
|
|
361
409
|
|
|
@@ -394,8 +442,11 @@ namespace Hyper.Internal.Managers
|
|
|
394
442
|
}
|
|
395
443
|
|
|
396
444
|
yield return new WaitForSecondsRealtime(2f);
|
|
445
|
+
|
|
446
|
+
_sendGameStartedCoroutine = null;
|
|
397
447
|
}
|
|
398
448
|
|
|
449
|
+
|
|
399
450
|
#endregion
|
|
400
451
|
|
|
401
452
|
#region WebSocket Event Handlers
|
|
@@ -405,6 +456,7 @@ namespace Hyper.Internal.Managers
|
|
|
405
456
|
if (_gameManager.HasGameStarted)
|
|
406
457
|
{
|
|
407
458
|
_gameManager?.ShowConnectionRestored();
|
|
459
|
+
SendGameResumed();
|
|
408
460
|
}
|
|
409
461
|
else
|
|
410
462
|
{
|
|
@@ -458,7 +510,10 @@ namespace Hyper.Internal.Managers
|
|
|
458
510
|
|
|
459
511
|
public void OnSocketGameResumed(string message)
|
|
460
512
|
{
|
|
513
|
+
_gameResumed = true;
|
|
514
|
+
|
|
461
515
|
TryUpdateCSRFToken(message);
|
|
516
|
+
ResumeScoreSending();
|
|
462
517
|
}
|
|
463
518
|
|
|
464
519
|
public void OnSocketMessage(string message)
|
|
@@ -493,6 +548,15 @@ namespace Hyper.Internal.Managers
|
|
|
493
548
|
}
|
|
494
549
|
}
|
|
495
550
|
|
|
551
|
+
private void ResumeScoreSending()
|
|
552
|
+
{
|
|
553
|
+
if (isSocketConnected && !_gameManager.HasGameEnded)
|
|
554
|
+
{
|
|
555
|
+
_dataManager.StartCapturingScores();
|
|
556
|
+
StartSendingScores();
|
|
557
|
+
}
|
|
558
|
+
}
|
|
559
|
+
|
|
496
560
|
#endregion
|
|
497
561
|
|
|
498
562
|
#region Reconnection
|
|
@@ -620,6 +684,20 @@ namespace Hyper.Internal.Managers
|
|
|
620
684
|
yield break;
|
|
621
685
|
}
|
|
622
686
|
|
|
687
|
+
if (_sendGameResumedCoroutine == null)
|
|
688
|
+
{
|
|
689
|
+
_sendGameResumedCoroutine = StartCoroutine(SendGameResumedCoroutine());
|
|
690
|
+
|
|
691
|
+
//? Ensure game is resumed to get new CSRF token before final score submission
|
|
692
|
+
yield return _sendGameResumedCoroutine;
|
|
693
|
+
|
|
694
|
+
_sendGameResumedCoroutine = null;
|
|
695
|
+
}
|
|
696
|
+
else
|
|
697
|
+
{
|
|
698
|
+
yield return _sendGameResumedCoroutine;
|
|
699
|
+
}
|
|
700
|
+
|
|
623
701
|
object encryptedObject = JsonConvert.DeserializeObject(encryptedScoreData);
|
|
624
702
|
var payload = new { encryptedData = encryptedObject };
|
|
625
703
|
string jsonData = JsonConvert.SerializeObject(payload);
|
|
@@ -640,7 +718,7 @@ namespace Hyper.Internal.Managers
|
|
|
640
718
|
if (request.result == UnityWebRequest.Result.Success)
|
|
641
719
|
{
|
|
642
720
|
_gameManager?.GameOverModalComponent?.ScoreHasBeenSubmitted();
|
|
643
|
-
TryUpdateCSRFToken(request.downloadHandler.text);
|
|
721
|
+
// TryUpdateCSRFToken(request.downloadHandler.text);
|
|
644
722
|
StopWebSocket();
|
|
645
723
|
_endGameCoroutine = null;
|
|
646
724
|
yield break;
|
|
@@ -913,7 +991,7 @@ namespace Hyper.Internal.Managers
|
|
|
913
991
|
if (_dataManager == null) _dataManager = HyperRuntime.DataManager;
|
|
914
992
|
if (_eventManager == null) _eventManager = HyperRuntime.EventManager;
|
|
915
993
|
if (_gameManager == null) _gameManager = HyperRuntime.GameManager;
|
|
916
|
-
|
|
994
|
+
|
|
917
995
|
string eventName = eventType switch
|
|
918
996
|
{
|
|
919
997
|
ConsoleEventType.GameEnd => "GameEnd",
|
|
@@ -23,11 +23,13 @@ namespace Hyper.Internal.Managers
|
|
|
23
23
|
|
|
24
24
|
private DataManager _dataManager;
|
|
25
25
|
private EventManager _eventManager;
|
|
26
|
+
private BackendManager _backendManager;
|
|
26
27
|
|
|
27
28
|
private void Awake()
|
|
28
29
|
{
|
|
29
30
|
_dataManager = HyperRuntime.DataManager;
|
|
30
31
|
_eventManager = HyperRuntime.EventManager;
|
|
32
|
+
_backendManager = HyperRuntime.BackendManager;
|
|
31
33
|
}
|
|
32
34
|
|
|
33
35
|
internal void Initialize()
|
|
@@ -150,10 +152,18 @@ namespace Hyper.Internal.Managers
|
|
|
150
152
|
internal ControlBarLayout ControlBarLayout { get; private set; }
|
|
151
153
|
internal StartCTA StartCTA { get; private set; }
|
|
152
154
|
|
|
155
|
+
#region Game Pause Management
|
|
156
|
+
|
|
153
157
|
internal void PauseGame()
|
|
154
158
|
{
|
|
155
159
|
if (!_hasGameStarted || _isPaused || _hasGameEnded) return;
|
|
156
160
|
|
|
161
|
+
if (_backendManager.isSocketConnected)
|
|
162
|
+
{
|
|
163
|
+
_dataManager.StopCapturingScores();
|
|
164
|
+
_backendManager.StopSendingScores();
|
|
165
|
+
}
|
|
166
|
+
|
|
157
167
|
_isPaused = true;
|
|
158
168
|
_isFrozenBeforePause = Time.timeScale == 0;
|
|
159
169
|
Time.timeScale = 0;
|
|
@@ -167,6 +177,11 @@ namespace Hyper.Internal.Managers
|
|
|
167
177
|
|
|
168
178
|
internal void ResumeGame()
|
|
169
179
|
{
|
|
180
|
+
if (_backendManager.isSocketConnected)
|
|
181
|
+
{
|
|
182
|
+
_backendManager.SendGameResumed();
|
|
183
|
+
}
|
|
184
|
+
|
|
170
185
|
_isPaused = false;
|
|
171
186
|
|
|
172
187
|
if (!_isFrozenBeforePause)
|
|
@@ -181,6 +196,30 @@ namespace Hyper.Internal.Managers
|
|
|
181
196
|
_eventManager.InvokeGameResumedEvent();
|
|
182
197
|
}
|
|
183
198
|
|
|
199
|
+
void OnApplicationFocus(bool hasFocus)
|
|
200
|
+
{
|
|
201
|
+
HandlePauseState(!hasFocus);
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
void OnApplicationPause(bool pauseStatus)
|
|
205
|
+
{
|
|
206
|
+
HandlePauseState(pauseStatus);
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
void HandlePauseState(bool shouldPause)
|
|
210
|
+
{
|
|
211
|
+
if (shouldPause && !_isPaused)
|
|
212
|
+
{
|
|
213
|
+
PauseGame();
|
|
214
|
+
}
|
|
215
|
+
else if (!shouldPause && _isPaused)
|
|
216
|
+
{
|
|
217
|
+
// ResumeGame();
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
#endregion
|
|
222
|
+
|
|
184
223
|
internal void UpdateScoreLabel()
|
|
185
224
|
{
|
|
186
225
|
_controlBarModal?.UpdateScoreLabel();
|
|
@@ -734,6 +773,7 @@ namespace Hyper.Internal.Managers
|
|
|
734
773
|
|
|
735
774
|
string menuSceneName = HyperRuntime.GameContent.IsPracticeMenu ?
|
|
736
775
|
HyperRuntime.GameContent.PracticeScene?.SceneName : null;
|
|
776
|
+
|
|
737
777
|
string transitionSceneName = HyperRuntime.GameContent.TransitionScene?.SceneName;
|
|
738
778
|
|
|
739
779
|
if ((!string.IsNullOrEmpty(menuSceneName) && scene.name.Equals(menuSceneName, StringComparison.OrdinalIgnoreCase)) ||
|
|
@@ -1327,6 +1367,8 @@ namespace Hyper.Internal.Managers
|
|
|
1327
1367
|
|
|
1328
1368
|
private void ShowTimeUpModalInternal()
|
|
1329
1369
|
{
|
|
1370
|
+
_hasGameEnded = true;
|
|
1371
|
+
|
|
1330
1372
|
if (_timeUpModal == null)
|
|
1331
1373
|
{
|
|
1332
1374
|
EnsureTimeUpModal();
|
|
@@ -35,8 +35,8 @@ namespace Hyper.Internal.Managers
|
|
|
35
35
|
private float _fiveSecondTimer = 5f;
|
|
36
36
|
private bool _isFiveSecondTimerRunning;
|
|
37
37
|
private bool _startDeadlineTriggered;
|
|
38
|
-
|
|
39
38
|
private float _sessionTimer = SESSION_DURATION;
|
|
39
|
+
private bool _isPreSessionRunning;
|
|
40
40
|
private bool _isSessionRunning;
|
|
41
41
|
private bool _sessionWarningTriggered;
|
|
42
42
|
private bool _timeUpTriggered;
|
|
@@ -70,8 +70,6 @@ namespace Hyper.Internal.Managers
|
|
|
70
70
|
|
|
71
71
|
public int SessionTimeRemaining => (int)_sessionTimer;
|
|
72
72
|
|
|
73
|
-
public bool IsSessionActive => _isSessionRunning;
|
|
74
|
-
|
|
75
73
|
private GameManager _gameManager;
|
|
76
74
|
private EventManager _eventManager;
|
|
77
75
|
|
|
@@ -153,14 +151,24 @@ namespace Hyper.Internal.Managers
|
|
|
153
151
|
|
|
154
152
|
internal void StartSessionTimer(bool isPreSessionTimer = false)
|
|
155
153
|
{
|
|
154
|
+
if(_isPreSessionRunning && _isSessionRunning) return; // Already running both timers
|
|
155
|
+
|
|
156
156
|
#if UNITY_WEBGL && !UNITY_EDITOR
|
|
157
157
|
StartHTMLSessionTimer();
|
|
158
158
|
#endif
|
|
159
159
|
_sessionTimer = SESSION_DURATION;
|
|
160
|
-
_isSessionRunning = true;
|
|
161
160
|
_sessionWarningTriggered = false;
|
|
162
161
|
_startDeadlineTriggered = false;
|
|
163
162
|
_lastUnscaledTime = Time.unscaledTime;
|
|
163
|
+
|
|
164
|
+
if (!isPreSessionTimer)
|
|
165
|
+
{
|
|
166
|
+
_isSessionRunning = true;
|
|
167
|
+
}
|
|
168
|
+
else
|
|
169
|
+
{
|
|
170
|
+
_isPreSessionRunning = true;
|
|
171
|
+
}
|
|
164
172
|
}
|
|
165
173
|
|
|
166
174
|
#endregion
|
|
@@ -207,7 +215,7 @@ namespace Hyper.Internal.Managers
|
|
|
207
215
|
|
|
208
216
|
private void UpdateSessionTimer(float unscaledDelta)
|
|
209
217
|
{
|
|
210
|
-
if (!
|
|
218
|
+
if (!_isPreSessionRunning) return;
|
|
211
219
|
|
|
212
220
|
_sessionTimer -= unscaledDelta;
|
|
213
221
|
|
|
@@ -233,6 +241,7 @@ namespace Hyper.Internal.Managers
|
|
|
233
241
|
{
|
|
234
242
|
_sessionTimer = 0;
|
|
235
243
|
_isSessionRunning = false;
|
|
244
|
+
_isPreSessionRunning = false;
|
|
236
245
|
_eventManager?.InvokeSessionTimeOutEvent();
|
|
237
246
|
}
|
|
238
247
|
}
|
|
@@ -30,14 +30,7 @@ namespace Hyper.Internal
|
|
|
30
30
|
lost.SetActive(true);
|
|
31
31
|
restored.SetActive(false);
|
|
32
32
|
|
|
33
|
-
rectTransform.DOAnchorPosY(
|
|
34
|
-
{
|
|
35
|
-
// // After 2 seconds, move it back up
|
|
36
|
-
// HyperTween.DelayedCall(4f, () =>
|
|
37
|
-
// {
|
|
38
|
-
// rectTransform.DOAnchorPosY(-100f, 0.5f).SetUpdate(true).SetEase(HyperTween.Ease.InQuad);
|
|
39
|
-
// });
|
|
40
|
-
});
|
|
33
|
+
rectTransform.DOAnchorPosY(0f, 0.5f).SetUpdate(true).SetEase(HyperTween.Ease.InQuad);
|
|
41
34
|
}
|
|
42
35
|
|
|
43
36
|
void ConnectionRestored()
|
|
@@ -45,9 +38,8 @@ namespace Hyper.Internal
|
|
|
45
38
|
lost.SetActive(false);
|
|
46
39
|
restored.SetActive(true);
|
|
47
40
|
|
|
48
|
-
rectTransform.DOAnchorPosY(
|
|
41
|
+
rectTransform.DOAnchorPosY(0, 0.5f).SetUpdate(true).SetEase(HyperTween.Ease.InQuad).OnComplete(() =>
|
|
49
42
|
{
|
|
50
|
-
// After 2 seconds, move it back up
|
|
51
43
|
HyperTween.DelayedCall(4f, () =>
|
|
52
44
|
{
|
|
53
45
|
rectTransform.DOAnchorPosY(-100f, 0.5f).SetUpdate(true).SetEase(HyperTween.Ease.InQuad);
|
|
@@ -56,7 +56,7 @@ namespace Hyper.Internal
|
|
|
56
56
|
|
|
57
57
|
void HandleTutorialLoadingComplete()
|
|
58
58
|
{
|
|
59
|
-
Debug.Log($"Tutorial Loading Completed!");
|
|
59
|
+
// Debug.Log($"Tutorial Loading Completed!");
|
|
60
60
|
|
|
61
61
|
// Fade out and disable
|
|
62
62
|
tutorialLoaderModalCG.DOFade(0, 0.15f).SetDelay(2f).SetUpdate(true).OnComplete(() =>
|
|
@@ -38,7 +38,6 @@ mergeInto(LibraryManager.library, {
|
|
|
38
38
|
|
|
39
39
|
MarkGameStartedOnHTML: function () {
|
|
40
40
|
if (window.markGameStarted) {
|
|
41
|
-
console.log("Called MarkGameStarted successfully");
|
|
42
41
|
window.markGameStarted();
|
|
43
42
|
} else {
|
|
44
43
|
console.error("markGameStarted() not found!");
|
|
@@ -47,7 +46,6 @@ mergeInto(LibraryManager.library, {
|
|
|
47
46
|
|
|
48
47
|
MarkGameLoadedOnHTML: function () {
|
|
49
48
|
if (window.markGameLoaded) {
|
|
50
|
-
console.log("Called MarkGameLoaded successfully");
|
|
51
49
|
window.markGameLoaded();
|
|
52
50
|
} else {
|
|
53
51
|
console.error("markGameLoaded() not found!");
|
|
@@ -112,9 +110,9 @@ mergeInto(LibraryManager.library, {
|
|
|
112
110
|
try {
|
|
113
111
|
if (window.parent && window.parent !== window) {
|
|
114
112
|
window.parent.postMessage(eventDataStr, "*");
|
|
115
|
-
console.log("Stringified message sent to parent");
|
|
113
|
+
// console.log("Stringified message sent to parent");
|
|
116
114
|
} else {
|
|
117
|
-
console.log("No parent window found or same window");
|
|
115
|
+
// console.log("No parent window found or same window");
|
|
118
116
|
}
|
|
119
117
|
} catch (error) {
|
|
120
118
|
console.error("Failed to send message to parent:", error);
|
|
@@ -126,7 +124,10 @@ mergeInto(LibraryManager.library, {
|
|
|
126
124
|
// Run only on iOS-like browsers (Safari/Chrome on iOS share WebKit)
|
|
127
125
|
var iOS = /iPad|iPhone|iPod/.test(navigator.userAgent) ||
|
|
128
126
|
(navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1);
|
|
129
|
-
if (!iOS) {
|
|
127
|
+
if (!iOS) {
|
|
128
|
+
// console.log('Unity: iOS inline video fix skipped (not iOS)');
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
130
131
|
|
|
131
132
|
function fixVideo(v) {
|
|
132
133
|
v.setAttribute('playsinline', '');
|
|
@@ -137,9 +138,9 @@ mergeInto(LibraryManager.library, {
|
|
|
137
138
|
v.addEventListener('webkitbeginfullscreen', function (e) {
|
|
138
139
|
e.preventDefault();
|
|
139
140
|
try { e.stopImmediatePropagation(); } catch (_) { }
|
|
140
|
-
console.log('Unity: Prevented iOS fullscreen');
|
|
141
|
+
// console.log('Unity: Prevented iOS fullscreen');
|
|
141
142
|
}, true);
|
|
142
|
-
console.log('Unity: configured video for iOS inline playback');
|
|
143
|
+
// console.log('Unity: configured video for iOS inline playback');
|
|
143
144
|
}
|
|
144
145
|
|
|
145
146
|
// Fix any existing videos
|
|
@@ -157,7 +158,7 @@ mergeInto(LibraryManager.library, {
|
|
|
157
158
|
});
|
|
158
159
|
});
|
|
159
160
|
mo.observe(document.documentElement, { childList: true, subtree: true });
|
|
160
|
-
console.log('Unity: iOS inline video fix registered');
|
|
161
|
+
// console.log('Unity: iOS inline video fix registered');
|
|
161
162
|
} catch (err) {
|
|
162
163
|
console.error('Unity: iOS inline video fix error', err);
|
|
163
164
|
}
|
|
@@ -75,7 +75,6 @@ mergeInto(LibraryManager.library, {
|
|
|
75
75
|
}
|
|
76
76
|
|
|
77
77
|
window.socketInstance.emit(payload.event, payload.data, (ackResponse) => {
|
|
78
|
-
console.log("[WebSocket] ACK received:", ackResponse);
|
|
79
78
|
try {
|
|
80
79
|
const ackJson = JSON.stringify(ackResponse);
|
|
81
80
|
SendMessage('HyperSDKSingleton', 'OnSocketMessage', ackJson);
|
|
@@ -26,17 +26,17 @@ RectTransform:
|
|
|
26
26
|
m_GameObject: {fileID: 1048866143089788928}
|
|
27
27
|
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
|
28
28
|
m_LocalPosition: {x: 0, y: 0, z: 0}
|
|
29
|
-
m_LocalScale: {x:
|
|
30
|
-
m_ConstrainProportionsScale:
|
|
29
|
+
m_LocalScale: {x: 0.8, y: 0.8, z: 0.8}
|
|
30
|
+
m_ConstrainProportionsScale: 1
|
|
31
31
|
m_Children:
|
|
32
32
|
- {fileID: 8309774266759315490}
|
|
33
33
|
- {fileID: 737453627717873146}
|
|
34
|
-
m_Father: {fileID:
|
|
34
|
+
m_Father: {fileID: 5674028873514353123}
|
|
35
35
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
|
36
|
-
m_AnchorMin: {x:
|
|
37
|
-
m_AnchorMax: {x:
|
|
38
|
-
m_AnchoredPosition: {x:
|
|
39
|
-
m_SizeDelta: {x:
|
|
36
|
+
m_AnchorMin: {x: 0.5, y: 0.5}
|
|
37
|
+
m_AnchorMax: {x: 0.5, y: 0.5}
|
|
38
|
+
m_AnchoredPosition: {x: 0, y: 0}
|
|
39
|
+
m_SizeDelta: {x: 103.8133, y: 108.9792}
|
|
40
40
|
m_Pivot: {x: 0.5, y: 0.5}
|
|
41
41
|
--- !u!114 &8174422555707274544
|
|
42
42
|
MonoBehaviour:
|
|
@@ -85,7 +85,7 @@ RectTransform:
|
|
|
85
85
|
- {fileID: 4203918634244751565}
|
|
86
86
|
- {fileID: 3751917781741926748}
|
|
87
87
|
- {fileID: 2951596604433264409}
|
|
88
|
-
- {fileID:
|
|
88
|
+
- {fileID: 5674028873514353123}
|
|
89
89
|
- {fileID: 19893713024797808}
|
|
90
90
|
m_Father: {fileID: 4867582869548686450}
|
|
91
91
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
|
@@ -160,15 +160,15 @@ RectTransform:
|
|
|
160
160
|
m_GameObject: {fileID: 2473909893973907380}
|
|
161
161
|
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
|
162
162
|
m_LocalPosition: {x: 0, y: 0, z: 0}
|
|
163
|
-
m_LocalScale: {x:
|
|
164
|
-
m_ConstrainProportionsScale:
|
|
163
|
+
m_LocalScale: {x: 1, y: 1, z: 1}
|
|
164
|
+
m_ConstrainProportionsScale: 1
|
|
165
165
|
m_Children: []
|
|
166
166
|
m_Father: {fileID: 3038526082762213112}
|
|
167
167
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
|
168
168
|
m_AnchorMin: {x: 0, y: 0}
|
|
169
169
|
m_AnchorMax: {x: 1, y: 1}
|
|
170
|
-
m_AnchoredPosition: {x: 0, y:
|
|
171
|
-
m_SizeDelta: {x:
|
|
170
|
+
m_AnchoredPosition: {x: 0.17333984, y: 1.8095093}
|
|
171
|
+
m_SizeDelta: {x: -3.8133545, y: -5.839813}
|
|
172
172
|
m_Pivot: {x: 0.5, y: 0.5}
|
|
173
173
|
--- !u!222 &4904993199147460690
|
|
174
174
|
CanvasRenderer:
|
|
@@ -200,7 +200,7 @@ MonoBehaviour:
|
|
|
200
200
|
m_Calls: []
|
|
201
201
|
m_Sprite: {fileID: 21300000, guid: 4fb89f5103c371a439c5f81fdced2c0c, type: 3}
|
|
202
202
|
m_Type: 0
|
|
203
|
-
m_PreserveAspect:
|
|
203
|
+
m_PreserveAspect: 1
|
|
204
204
|
m_FillCenter: 1
|
|
205
205
|
m_FillMethod: 4
|
|
206
206
|
m_FillAmount: 1
|
|
@@ -215,7 +215,7 @@ MonoBehaviour:
|
|
|
215
215
|
m_PrefabInstance: {fileID: 0}
|
|
216
216
|
m_PrefabAsset: {fileID: 0}
|
|
217
217
|
m_GameObject: {fileID: 2473909893973907380}
|
|
218
|
-
m_Enabled:
|
|
218
|
+
m_Enabled: 0
|
|
219
219
|
m_EditorHideFlags: 0
|
|
220
220
|
m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3}
|
|
221
221
|
m_Name:
|
|
@@ -247,7 +247,7 @@ MonoBehaviour:
|
|
|
247
247
|
m_PressedTrigger: Pressed
|
|
248
248
|
m_SelectedTrigger: Selected
|
|
249
249
|
m_DisabledTrigger: Disabled
|
|
250
|
-
m_Interactable:
|
|
250
|
+
m_Interactable: 1
|
|
251
251
|
m_TargetGraphic: {fileID: 8771623675020164658}
|
|
252
252
|
m_OnClick:
|
|
253
253
|
m_PersistentCalls:
|
|
@@ -504,15 +504,15 @@ RectTransform:
|
|
|
504
504
|
m_GameObject: {fileID: 4434394802318301849}
|
|
505
505
|
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
|
506
506
|
m_LocalPosition: {x: 0, y: 0, z: 0}
|
|
507
|
-
m_LocalScale: {x:
|
|
508
|
-
m_ConstrainProportionsScale:
|
|
507
|
+
m_LocalScale: {x: 1, y: 1, z: 1}
|
|
508
|
+
m_ConstrainProportionsScale: 1
|
|
509
509
|
m_Children: []
|
|
510
510
|
m_Father: {fileID: 3038526082762213112}
|
|
511
511
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
|
512
512
|
m_AnchorMin: {x: 0, y: 0}
|
|
513
513
|
m_AnchorMax: {x: 1, y: 1}
|
|
514
|
-
m_AnchoredPosition: {x: 0, y:
|
|
515
|
-
m_SizeDelta: {x:
|
|
514
|
+
m_AnchoredPosition: {x: 0.17333984, y: 1.8095093}
|
|
515
|
+
m_SizeDelta: {x: -3.8133545, y: -5.839813}
|
|
516
516
|
m_Pivot: {x: 0.5, y: 0.5}
|
|
517
517
|
--- !u!222 &5308926542114210481
|
|
518
518
|
CanvasRenderer:
|
|
@@ -544,7 +544,7 @@ MonoBehaviour:
|
|
|
544
544
|
m_Calls: []
|
|
545
545
|
m_Sprite: {fileID: 21300000, guid: 2ed7d5715e8d9804982046f22fd6d4e8, type: 3}
|
|
546
546
|
m_Type: 0
|
|
547
|
-
m_PreserveAspect:
|
|
547
|
+
m_PreserveAspect: 1
|
|
548
548
|
m_FillCenter: 1
|
|
549
549
|
m_FillMethod: 4
|
|
550
550
|
m_FillAmount: 1
|
|
@@ -1062,6 +1062,96 @@ MonoBehaviour:
|
|
|
1062
1062
|
pauseBarsDark: {fileID: 21300000, guid: 023ea868e45992b46ab65bc4b6fb72c7, type: 3}
|
|
1063
1063
|
livesDisplayPrefab: {fileID: 5031749136894004241, guid: b7f1d0f9e3734df4c9feb3385b835f4b, type: 3}
|
|
1064
1064
|
healthBarDisplayPrefab: {fileID: 1417749867448633337, guid: 22043bd14ddce8947800ab23f5fdff24, type: 3}
|
|
1065
|
+
--- !u!1 &7998827318738212946
|
|
1066
|
+
GameObject:
|
|
1067
|
+
m_ObjectHideFlags: 0
|
|
1068
|
+
m_CorrespondingSourceObject: {fileID: 0}
|
|
1069
|
+
m_PrefabInstance: {fileID: 0}
|
|
1070
|
+
m_PrefabAsset: {fileID: 0}
|
|
1071
|
+
serializedVersion: 6
|
|
1072
|
+
m_Component:
|
|
1073
|
+
- component: {fileID: 5674028873514353123}
|
|
1074
|
+
- component: {fileID: 5207791156461544556}
|
|
1075
|
+
- component: {fileID: 6042180838967743657}
|
|
1076
|
+
- component: {fileID: 4550745912745357072}
|
|
1077
|
+
m_Layer: 5
|
|
1078
|
+
m_Name: ConnStatusIcon Holder
|
|
1079
|
+
m_TagString: Untagged
|
|
1080
|
+
m_Icon: {fileID: 0}
|
|
1081
|
+
m_NavMeshLayer: 0
|
|
1082
|
+
m_StaticEditorFlags: 0
|
|
1083
|
+
m_IsActive: 1
|
|
1084
|
+
--- !u!224 &5674028873514353123
|
|
1085
|
+
RectTransform:
|
|
1086
|
+
m_ObjectHideFlags: 0
|
|
1087
|
+
m_CorrespondingSourceObject: {fileID: 0}
|
|
1088
|
+
m_PrefabInstance: {fileID: 0}
|
|
1089
|
+
m_PrefabAsset: {fileID: 0}
|
|
1090
|
+
m_GameObject: {fileID: 7998827318738212946}
|
|
1091
|
+
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
|
1092
|
+
m_LocalPosition: {x: 0, y: 0, z: 0}
|
|
1093
|
+
m_LocalScale: {x: 1, y: 1, z: 1}
|
|
1094
|
+
m_ConstrainProportionsScale: 0
|
|
1095
|
+
m_Children:
|
|
1096
|
+
- {fileID: 3038526082762213112}
|
|
1097
|
+
m_Father: {fileID: 169989670260607081}
|
|
1098
|
+
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
|
1099
|
+
m_AnchorMin: {x: 1, y: 0.5}
|
|
1100
|
+
m_AnchorMax: {x: 1, y: 0.5}
|
|
1101
|
+
m_AnchoredPosition: {x: -182, y: 12.215299}
|
|
1102
|
+
m_SizeDelta: {x: 83.05066, y: 87.183365}
|
|
1103
|
+
m_Pivot: {x: 0.5, y: 0.5}
|
|
1104
|
+
--- !u!222 &5207791156461544556
|
|
1105
|
+
CanvasRenderer:
|
|
1106
|
+
m_ObjectHideFlags: 0
|
|
1107
|
+
m_CorrespondingSourceObject: {fileID: 0}
|
|
1108
|
+
m_PrefabInstance: {fileID: 0}
|
|
1109
|
+
m_PrefabAsset: {fileID: 0}
|
|
1110
|
+
m_GameObject: {fileID: 7998827318738212946}
|
|
1111
|
+
m_CullTransparentMesh: 1
|
|
1112
|
+
--- !u!114 &6042180838967743657
|
|
1113
|
+
MonoBehaviour:
|
|
1114
|
+
m_ObjectHideFlags: 0
|
|
1115
|
+
m_CorrespondingSourceObject: {fileID: 0}
|
|
1116
|
+
m_PrefabInstance: {fileID: 0}
|
|
1117
|
+
m_PrefabAsset: {fileID: 0}
|
|
1118
|
+
m_GameObject: {fileID: 7998827318738212946}
|
|
1119
|
+
m_Enabled: 1
|
|
1120
|
+
m_EditorHideFlags: 0
|
|
1121
|
+
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
|
|
1122
|
+
m_Name:
|
|
1123
|
+
m_EditorClassIdentifier:
|
|
1124
|
+
m_Material: {fileID: 0}
|
|
1125
|
+
m_Color: {r: 0, g: 0, b: 0, a: 1}
|
|
1126
|
+
m_RaycastTarget: 1
|
|
1127
|
+
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
|
1128
|
+
m_Maskable: 1
|
|
1129
|
+
m_OnCullStateChanged:
|
|
1130
|
+
m_PersistentCalls:
|
|
1131
|
+
m_Calls: []
|
|
1132
|
+
m_Sprite: {fileID: 0}
|
|
1133
|
+
m_Type: 0
|
|
1134
|
+
m_PreserveAspect: 0
|
|
1135
|
+
m_FillCenter: 1
|
|
1136
|
+
m_FillMethod: 4
|
|
1137
|
+
m_FillAmount: 1
|
|
1138
|
+
m_FillClockwise: 1
|
|
1139
|
+
m_FillOrigin: 0
|
|
1140
|
+
m_UseSpriteMesh: 0
|
|
1141
|
+
m_PixelsPerUnitMultiplier: 1
|
|
1142
|
+
--- !u!114 &4550745912745357072
|
|
1143
|
+
MonoBehaviour:
|
|
1144
|
+
m_ObjectHideFlags: 0
|
|
1145
|
+
m_CorrespondingSourceObject: {fileID: 0}
|
|
1146
|
+
m_PrefabInstance: {fileID: 0}
|
|
1147
|
+
m_PrefabAsset: {fileID: 0}
|
|
1148
|
+
m_GameObject: {fileID: 7998827318738212946}
|
|
1149
|
+
m_Enabled: 1
|
|
1150
|
+
m_EditorHideFlags: 0
|
|
1151
|
+
m_Script: {fileID: 11500000, guid: 31a19414c41e5ae4aae2af33fee712f6, type: 3}
|
|
1152
|
+
m_Name:
|
|
1153
|
+
m_EditorClassIdentifier:
|
|
1154
|
+
m_ShowMaskGraphic: 0
|
|
1065
1155
|
--- !u!1 &8984078937237801384
|
|
1066
1156
|
GameObject:
|
|
1067
1157
|
m_ObjectHideFlags: 0
|
|
@@ -1124,7 +1124,7 @@ MonoBehaviour:
|
|
|
1124
1124
|
m_Name:
|
|
1125
1125
|
m_EditorClassIdentifier:
|
|
1126
1126
|
m_Material: {fileID: 0}
|
|
1127
|
-
m_Color: {r: 0.
|
|
1127
|
+
m_Color: {r: 0.30588236, g: 0.23529413, b: 0.7607844, a: 1}
|
|
1128
1128
|
m_RaycastTarget: 1
|
|
1129
1129
|
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
|
1130
1130
|
m_Maskable: 1
|
|
@@ -688,7 +688,7 @@ MonoBehaviour:
|
|
|
688
688
|
m_Name:
|
|
689
689
|
m_EditorClassIdentifier:
|
|
690
690
|
m_Material: {fileID: 0}
|
|
691
|
-
m_Color: {r: 0.
|
|
691
|
+
m_Color: {r: 0.30588236, g: 0.23529413, b: 0.7607844, a: 1}
|
|
692
692
|
m_RaycastTarget: 1
|
|
693
693
|
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
|
694
694
|
m_Maskable: 1
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "app.hypergames.hypersdk",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.12",
|
|
4
4
|
"displayName": "HyperSDK",
|
|
5
5
|
"description": "Official Unity SDK for Hyper: multiplayer battles, leaderboards, deterministic RNG, session management, tutorials, and WebGL optimizations for production-ready games.",
|
|
6
6
|
"unity": "6000.0",
|