app.hypergames.hypersdk 1.4.17 → 1.4.18

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.18](https://github.com/mvmhyper/hyper-sdk/compare/v1.4.17...v1.4.18) (2026-01-06)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * update safe area handling ([7e177e5](https://github.com/mvmhyper/hyper-sdk/commit/7e177e5b191251ff44096f02084fd0eabb7827c5))
7
+
1
8
  ## [1.4.17](https://github.com/mvmhyper/hyper-sdk/compare/v1.4.16...v1.4.17) (2026-01-06)
2
9
 
3
10
 
@@ -488,7 +488,7 @@ namespace Hyper.Internal.Managers
488
488
  EnsurePracticeGameOverModal();
489
489
  _practiceGameOverModal.SetActive(true);
490
490
  }
491
-
491
+
492
492
  SetBlockerActive(true);
493
493
  }
494
494
 
@@ -914,14 +914,15 @@ namespace Hyper.Internal.Managers
914
914
 
915
915
  private void ApplySafeArea()
916
916
  {
917
- CanvasScaler[] allCanvases = FindObjectsByType<CanvasScaler>(FindObjectsSortMode.None);
917
+ var canvases = FindObjectsByType<Canvas>(FindObjectsSortMode.None);
918
918
 
919
- foreach (CanvasScaler canvas in allCanvases)
919
+ foreach (var canvas in canvases)
920
920
  {
921
- if (canvas.gameObject.name == "HyperCanvas") continue;
921
+ if (canvas.name == "HyperCanvas") continue;
922
+ if (canvas.GetComponentInChildren<SafeArea>(true) != null) continue;
922
923
 
923
- GameObject safeArea = new GameObject("SafeArea", typeof(RectTransform));
924
- RectTransform safeAreaRect = safeArea.GetComponent<RectTransform>();
924
+ var safeAreaGO = new GameObject("SafeArea", typeof(RectTransform), typeof(SafeArea));
925
+ var safeAreaRect = (RectTransform)safeAreaGO.transform;
925
926
  safeAreaRect.SetParent(canvas.transform, false);
926
927
 
927
928
  safeAreaRect.anchorMin = Vector2.zero;
@@ -929,21 +930,17 @@ namespace Hyper.Internal.Managers
929
930
  safeAreaRect.offsetMin = Vector2.zero;
930
931
  safeAreaRect.offsetMax = Vector2.zero;
931
932
 
932
- List<Transform> children = new List<Transform>();
933
+ var toMove = new List<Transform>();
933
934
  foreach (Transform child in canvas.transform)
934
935
  {
935
- if (child != safeAreaRect)
936
- {
937
- children.Add(child);
938
- }
936
+ if (child == safeAreaRect) continue;
937
+ toMove.Add(child);
939
938
  }
940
939
 
941
- foreach (Transform child in children)
940
+ foreach (var child in toMove)
942
941
  {
943
- child.SetParent(safeAreaRect, true);
942
+ child.SetParent(safeAreaRect, false);
944
943
  }
945
-
946
- safeArea.AddComponent<SafeArea>();
947
944
  }
948
945
  }
949
946
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "app.hypergames.hypersdk",
3
- "version": "1.4.17",
3
+ "version": "1.4.18",
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",