app.hypergames.hypersdk 1.4.20 → 1.4.21

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 CHANGED
@@ -1,3 +1,10 @@
1
+ ## [1.4.21](https://github.com/mvmhyper/hyper-sdk/compare/v1.4.20...v1.4.21) (2026-01-12)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * Update restart flow to handle scene unloading and add custom restart option ([7f0d79a](https://github.com/mvmhyper/hyper-sdk/commit/7f0d79a5873d33a4a6d2ffb099b205861224d882))
7
+
1
8
  ## [1.4.20](https://github.com/mvmhyper/hyper-sdk/compare/v1.4.19...v1.4.20) (2026-01-12)
2
9
 
3
10
 
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.205, y: -280.1698}
307
+ m_AnchoredPosition: {x: 489.20746, 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
@@ -426,7 +426,7 @@ Canvas:
426
426
  m_OverridePixelPerfect: 0
427
427
  m_SortingBucketNormalizedSize: 0
428
428
  m_VertexColorAlwaysGammaSpace: 0
429
- m_AdditionalShaderChannelsFlag: 7
429
+ m_AdditionalShaderChannelsFlag: 31
430
430
  m_UpdateRectTransformForStandalone: 0
431
431
  m_SortingLayerID: 0
432
432
  m_SortingOrder: 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.205, y: -133.2274}
1095
+ m_AnchoredPosition: {x: 489.20746, 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
@@ -57,7 +57,14 @@ namespace Hyper.Internal
57
57
 
58
58
  if (_settings != null && _settings.useCustomRestartFlow)
59
59
  {
60
+ // Fire custom restart event - developers handle restart themselves
60
61
  _eventManager?.InvokeCustomRestartEvent();
62
+
63
+ // Reset SDK UI state for custom restart
64
+ // This prepares the SDK UI (hides game over, shows start modal, resets timer, etc.)
65
+ // so the game appears fresh when the developer's restart logic runs
66
+ _gameManager?.ResetUIStateForCustomRestart();
67
+
61
68
  return;
62
69
  }
63
70
 
@@ -1,4 +1,4 @@
1
- using System;
1
+ using System;
2
2
  using System.Collections;
3
3
  using System.Collections.Generic;
4
4
  using System.Runtime.InteropServices;
@@ -871,6 +871,34 @@ namespace Hyper.Internal.Managers
871
871
 
872
872
  #endregion
873
873
 
874
+ #region Custom Restart Cleanup
875
+
876
+ /// <summary>
877
+ /// Resets SDK UI state for custom restart flow.
878
+ /// Called after OnCustomRestart event is fired to prepare the SDK for the developer's restart logic.
879
+ /// </summary>
880
+ internal void ResetUIStateForCustomRestart()
881
+ {
882
+ HideGameOverModal();
883
+ HidePauseModals();
884
+
885
+ // Reset game state flags
886
+ _hasGameStarted = false;
887
+ _hasGameEnded = false;
888
+ _isPaused = false;
889
+ _isFrozenBeforePause = false;
890
+
891
+ HyperRuntime.Timer.Reset();
892
+ HyperRuntime.DataManager.UpdateScore(0);
893
+
894
+ ShowControlBarElements();
895
+ ShowStartingInstructionModal();
896
+
897
+ Time.timeScale = 1;
898
+ }
899
+
900
+ #endregion
901
+
874
902
  #region Game End Logic
875
903
 
876
904
  private void EndGameInternal()
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "app.hypergames.hypersdk",
3
- "version": "1.4.20",
3
+ "version": "1.4.21",
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",