app.hypergames.hypersdk 1.5.1 → 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,18 @@
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
+
9
+ ## [1.5.2](https://github.com/mvmhyper/hyper-sdk/compare/v1.5.1...v1.5.2) (2026-02-09)
10
+
11
+
12
+ ### Bug Fixes
13
+
14
+ * Prevent premature input during scene transitions in StartingInstructionModal ([67a1180](https://github.com/mvmhyper/hyper-sdk/commit/67a1180de801aae0d44f8b8a5c81c9bde1e5e3e1))
15
+
1
16
  ## [1.5.1](https://github.com/mvmhyper/hyper-sdk/compare/v1.5.0...v1.5.1) (2026-02-04)
2
17
 
3
18
 
package/HyperLoader.unity CHANGED
@@ -305,7 +305,7 @@ RectTransform:
305
305
  m_AnchorMin: {x: 0, y: 1}
306
306
  m_AnchorMax: {x: 0, y: 1}
307
307
  m_AnchoredPosition: {x: 489.2762, y: -280.1698}
308
- m_SizeDelta: {x: 0, y: 239.347}
308
+ m_SizeDelta: {x: 1044.9, y: 239.347}
309
309
  m_Pivot: {x: 0.5, y: 0.5}
310
310
  --- !u!114 &751153944
311
311
  MonoBehaviour:
@@ -704,58 +704,10 @@ namespace Hyper.Internal.Managers
704
704
  private void AdjustSettingsBasedOnResolution()
705
705
  {
706
706
  #if !UNITY_EDITOR && UNITY_WEBGL
707
- int smallerDimension = Mathf.Min(Screen.width, Screen.height);
708
-
709
- if (smallerDimension <= 720)
710
- {
711
- SetLowPerformanceSettings();
712
- }
713
- else if (smallerDimension <= 1080)
714
- {
715
- SetMediumPerformanceSettings();
716
- }
717
- else
718
- {
719
- SetHighPerformanceSettings();
720
- }
721
-
722
707
  OptimizeForWebGL();
723
708
  #endif
724
709
  }
725
710
 
726
- private void SetLowPerformanceSettings()
727
- {
728
- QualitySettings.antiAliasing = 0;
729
- QualitySettings.shadows = ShadowQuality.Disable;
730
- QualitySettings.softParticles = false;
731
- QualitySettings.realtimeReflectionProbes = false;
732
- QualitySettings.pixelLightCount = 1;
733
- QualitySettings.anisotropicFiltering = AnisotropicFiltering.Disable;
734
- QualitySettings.vSyncCount = 0;
735
- }
736
-
737
- private void SetMediumPerformanceSettings()
738
- {
739
- QualitySettings.antiAliasing = 2;
740
- QualitySettings.shadows = ShadowQuality.HardOnly;
741
- QualitySettings.softParticles = true;
742
- QualitySettings.realtimeReflectionProbes = false;
743
- QualitySettings.pixelLightCount = 2;
744
- QualitySettings.anisotropicFiltering = AnisotropicFiltering.Enable;
745
- QualitySettings.vSyncCount = 1;
746
- }
747
-
748
- private void SetHighPerformanceSettings()
749
- {
750
- QualitySettings.antiAliasing = 4;
751
- QualitySettings.shadows = ShadowQuality.All;
752
- QualitySettings.softParticles = true;
753
- QualitySettings.realtimeReflectionProbes = true;
754
- QualitySettings.pixelLightCount = 4;
755
- QualitySettings.anisotropicFiltering = AnisotropicFiltering.ForceEnable;
756
- QualitySettings.vSyncCount = 1;
757
- }
758
-
759
711
  private void OptimizeForWebGL()
760
712
  {
761
713
  QualitySettings.streamingMipmapsActive = false;
@@ -775,13 +727,14 @@ namespace Hyper.Internal.Managers
775
727
  private void OnDisable()
776
728
  {
777
729
  SceneManager.sceneLoaded -= OnSceneLoaded;
730
+
778
731
  if (HyperRuntime.EventManager != null)
779
732
  {
780
733
  HyperRuntime.EventManager.OnGameStart -= HandleGameStarted;
781
734
  }
782
735
  }
783
736
 
784
- private void OnSceneLoaded(Scene scene, LoadSceneMode mode)
737
+ private void OnSceneLoaded(Scene newScene, LoadSceneMode loadSceneMode)
785
738
  {
786
739
  Time.timeScale = 1;
787
740
  _previousTimeScale = 1f; // Sync tracking on scene load
@@ -792,8 +745,8 @@ namespace Hyper.Internal.Managers
792
745
 
793
746
  string transitionSceneName = HyperRuntime.GameContent.TransitionScene?.SceneName;
794
747
 
795
- if ((!string.IsNullOrEmpty(menuSceneName) && scene.name.Equals(menuSceneName, StringComparison.OrdinalIgnoreCase)) ||
796
- (!string.IsNullOrEmpty(transitionSceneName) && scene.name.Equals(transitionSceneName, StringComparison.OrdinalIgnoreCase)))
748
+ if ((!string.IsNullOrEmpty(menuSceneName) && newScene.name.Equals(menuSceneName, StringComparison.OrdinalIgnoreCase)) ||
749
+ (!string.IsNullOrEmpty(transitionSceneName) && newScene.name.Equals(transitionSceneName, StringComparison.OrdinalIgnoreCase)))
797
750
  {
798
751
  IsInGameScene = false;
799
752
  _hasGameStarted = false;
@@ -938,13 +891,32 @@ namespace Hyper.Internal.Managers
938
891
  private void ApplySafeArea()
939
892
  {
940
893
  var canvases = FindObjectsByType<Canvas>(FindObjectsSortMode.None);
894
+ var canvasSet = new HashSet<Canvas>(canvases);
941
895
 
942
896
  foreach (var canvas in canvases)
943
897
  {
944
898
  if (canvas.name == "HyperCanvas") continue;
945
- if (canvas.GetComponentInChildren<SafeArea>(true) != null) continue;
946
899
 
947
- var safeAreaGO = new GameObject("SafeArea", typeof(RectTransform), typeof(SafeArea));
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));
948
920
  var safeAreaRect = (RectTransform)safeAreaGO.transform;
949
921
  safeAreaRect.SetParent(canvas.transform, false);
950
922
 
@@ -953,6 +925,8 @@ namespace Hyper.Internal.Managers
953
925
  safeAreaRect.offsetMin = Vector2.zero;
954
926
  safeAreaRect.offsetMax = Vector2.zero;
955
927
 
928
+ safeAreaGO.AddComponent<SafeArea>();
929
+
956
930
  var toMove = new List<Transform>();
957
931
  foreach (Transform child in canvas.transform)
958
932
  {
@@ -1,8 +1,10 @@
1
+ using System.Collections;
1
2
  using System.Runtime.InteropServices;
2
3
  using Hyper.Internal.Managers;
3
4
  using Hyper.Shared;
4
5
  using TMPro;
5
6
  using UnityEngine;
7
+ using UnityEngine.SceneManagement;
6
8
  using UnityEngine.UI;
7
9
 
8
10
  namespace Hyper.Internal
@@ -25,10 +27,10 @@ namespace Hyper.Internal
25
27
  private StartCTA _currentCTA;
26
28
  private SwipeDirection _swipeDirection;
27
29
 
28
- // Swipe detection variables
30
+ private bool _canAcceptInput = false;
29
31
  private Vector2 _swipeStartPosition;
30
32
  private bool _isTrackingSwipe;
31
- private const float SWIPE_THRESHOLD = 50f; // Minimum distance in pixels for a swipe
33
+ private const float SWIPE_THRESHOLD = 50f;
32
34
 
33
35
  void Awake()
34
36
  {
@@ -38,9 +40,26 @@ namespace Hyper.Internal
38
40
  _backendManager = HyperRuntime.BackendManager;
39
41
  }
40
42
 
43
+ void OnEnable()
44
+ {
45
+ _canAcceptInput = false;
46
+ StartCoroutine(EnableInputAfterDelay());
47
+ }
48
+
49
+ private IEnumerator EnableInputAfterDelay()
50
+ {
51
+ // Wait 5 frames to ensure scene transition is fully complete
52
+ yield return null;
53
+ yield return null;
54
+ yield return null;
55
+ yield return null;
56
+ yield return null;
57
+ _canAcceptInput = true;
58
+ }
59
+
41
60
  void Update()
42
61
  {
43
- if (!gameObject.activeSelf) return;
62
+ if (!gameObject.activeSelf || !_canAcceptInput) return;
44
63
 
45
64
  if (_currentCTA == StartCTA.TapToPlay)
46
65
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "app.hypergames.hypersdk",
3
- "version": "1.5.1",
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",