app.hypergames.hypersdk 1.5.2 → 1.5.3
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,11 @@
|
|
|
1
|
+
## [1.5.3](https://github.com/mvmhyper/hyper-sdk/compare/v1.5.2...v1.5.3) (2026-02-10)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* bump SDK version and update release branch to sdk/releaseTests ([dc1d32b](https://github.com/mvmhyper/hyper-sdk/commit/dc1d32bb067b0623b47a60eeb59fe8fca5828bea))
|
|
7
|
+
* ensure parent canvas takes precedence over nested canvases in SafeArea ([0d5931a](https://github.com/mvmhyper/hyper-sdk/commit/0d5931aa9bb21ecb6e1154339fe44e5af225145d))
|
|
8
|
+
|
|
1
9
|
## [1.5.2](https://github.com/mvmhyper/hyper-sdk/compare/v1.5.1...v1.5.2) (2026-02-09)
|
|
2
10
|
|
|
3
11
|
|
|
@@ -721,12 +721,12 @@ namespace Hyper.Internal.Managers
|
|
|
721
721
|
|
|
722
722
|
private void OnEnable()
|
|
723
723
|
{
|
|
724
|
-
SceneManager.
|
|
724
|
+
SceneManager.sceneLoaded += OnSceneLoaded;
|
|
725
725
|
}
|
|
726
726
|
|
|
727
727
|
private void OnDisable()
|
|
728
728
|
{
|
|
729
|
-
SceneManager.
|
|
729
|
+
SceneManager.sceneLoaded -= OnSceneLoaded;
|
|
730
730
|
|
|
731
731
|
if (HyperRuntime.EventManager != null)
|
|
732
732
|
{
|
|
@@ -734,7 +734,7 @@ namespace Hyper.Internal.Managers
|
|
|
734
734
|
}
|
|
735
735
|
}
|
|
736
736
|
|
|
737
|
-
private void
|
|
737
|
+
private void OnSceneLoaded(Scene newScene, LoadSceneMode loadSceneMode)
|
|
738
738
|
{
|
|
739
739
|
Time.timeScale = 1;
|
|
740
740
|
_previousTimeScale = 1f; // Sync tracking on scene load
|
|
@@ -891,13 +891,32 @@ namespace Hyper.Internal.Managers
|
|
|
891
891
|
private void ApplySafeArea()
|
|
892
892
|
{
|
|
893
893
|
var canvases = FindObjectsByType<Canvas>(FindObjectsSortMode.None);
|
|
894
|
+
var canvasSet = new HashSet<Canvas>(canvases);
|
|
894
895
|
|
|
895
896
|
foreach (var canvas in canvases)
|
|
896
897
|
{
|
|
897
898
|
if (canvas.name == "HyperCanvas") continue;
|
|
898
|
-
if (canvas.GetComponentInChildren<SafeArea>(true) != null) continue;
|
|
899
899
|
|
|
900
|
-
|
|
900
|
+
//? Skip if this canvas is a child/descendant of another canvas in the list
|
|
901
|
+
//? Only the parent canvas should take precedence
|
|
902
|
+
bool isNestedCanvas = false;
|
|
903
|
+
Transform parent = canvas.transform.parent;
|
|
904
|
+
while (parent != null)
|
|
905
|
+
{
|
|
906
|
+
var parentCanvas = parent.GetComponent<Canvas>();
|
|
907
|
+
if (parentCanvas != null && canvasSet.Contains(parentCanvas))
|
|
908
|
+
{
|
|
909
|
+
isNestedCanvas = true;
|
|
910
|
+
break;
|
|
911
|
+
}
|
|
912
|
+
parent = parent.parent;
|
|
913
|
+
}
|
|
914
|
+
|
|
915
|
+
if (isNestedCanvas) continue;
|
|
916
|
+
|
|
917
|
+
if (canvas.transform.childCount == 0) continue;
|
|
918
|
+
|
|
919
|
+
var safeAreaGO = new GameObject("SafeArea", typeof(RectTransform));
|
|
901
920
|
var safeAreaRect = (RectTransform)safeAreaGO.transform;
|
|
902
921
|
safeAreaRect.SetParent(canvas.transform, false);
|
|
903
922
|
|
|
@@ -906,6 +925,8 @@ namespace Hyper.Internal.Managers
|
|
|
906
925
|
safeAreaRect.offsetMin = Vector2.zero;
|
|
907
926
|
safeAreaRect.offsetMax = Vector2.zero;
|
|
908
927
|
|
|
928
|
+
safeAreaGO.AddComponent<SafeArea>();
|
|
929
|
+
|
|
909
930
|
var toMove = new List<Transform>();
|
|
910
931
|
foreach (Transform child in canvas.transform)
|
|
911
932
|
{
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "app.hypergames.hypersdk",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.3",
|
|
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",
|