app.hypergames.hypersdk 1.8.20 → 1.8.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.8.21](https://github.com/mvmhyper/hyper-sdk/compare/v1.8.20...v1.8.21) (2026-07-08)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * smooth tutorial loader and media switching ([b4cfbef](https://github.com/mvmhyper/hyper-sdk/commit/b4cfbef45d5544e7c5dfa37f702acb9f7be67548))
7
+
1
8
  ## [1.8.20](https://github.com/mvmhyper/hyper-sdk/compare/v1.8.19...v1.8.20) (2026-07-07)
2
9
 
3
10
 
@@ -36,10 +36,10 @@ namespace Hyper.Internal
36
36
  KillTweens();
37
37
  tutorialLoaderModalCG.alpha = 0f;
38
38
 
39
- // Fade in and enable
40
- tutorialLoaderModalCG.DOFade(1, 0.3f).SetUpdate(true);
41
-
42
39
  HandleLoadingTutorial();
40
+
41
+ // Fade in after loading state has reset its own tweens.
42
+ tutorialLoaderModalCG.DOFade(1, 0.3f).SetUpdate(true);
43
43
  }
44
44
 
45
45
  void OnDestroy()
@@ -124,6 +124,7 @@ namespace Hyper.Internal
124
124
  void HandleTutorialFailed()
125
125
  {
126
126
  KillTweens();
127
+ tutorialLoaderModalCG.alpha = 1f;
127
128
 
128
129
  loaderTextTween.SetActive(false);
129
130
  loaderText.SetActive(true);
@@ -21,6 +21,8 @@ namespace Hyper.Internal
21
21
  private const float SlideInDuration = 0.33f;
22
22
  private const float ContentFadeInDuration = 0.28f;
23
23
  private const float ContentFadeOutDuration = 0.18f;
24
+ private const float MediaFadeInDuration = 0.18f;
25
+ private const float VideoRevealDelay = 0.05f;
24
26
  private const float HiddenPreloadPlayDuration = 0.75f;
25
27
 
26
28
  #if UNITY_WEBGL && !UNITY_EDITOR
@@ -69,6 +71,7 @@ namespace Hyper.Internal
69
71
  private Coroutine updateVideoTimeCo = null;
70
72
  private Coroutine editorTutorialLoadCo = null;
71
73
  private Coroutine hiddenPreloadCloseCo = null;
74
+ private Coroutine mediaDisplayFadeCo = null;
72
75
  private TutorialData tutorialData;
73
76
  private bool isClosing;
74
77
  private bool hasInvokedTutorialLoadComplete;
@@ -621,6 +624,90 @@ namespace Hyper.Internal
621
624
  }
622
625
  }
623
626
 
627
+ private void ResetCardMediaState()
628
+ {
629
+ StopMediaDisplayFade();
630
+ ResetVideoProgressState();
631
+ HideMediaDisplay(tutorialDisplayP);
632
+ HideMediaDisplay(tutorialDisplayL);
633
+ HideMediaDisplay(tutorialImageDisplay);
634
+ }
635
+
636
+ private void ResetVideoProgressState()
637
+ {
638
+ cachedVideoLength = 0f;
639
+ isDraggingSlider = false;
640
+
641
+ if (timeSlider == null) return;
642
+
643
+ timeSlider.minValue = 0f;
644
+ timeSlider.maxValue = 1f;
645
+ timeSlider.value = 0f;
646
+ }
647
+
648
+ private void HideMediaDisplay(RawImage display)
649
+ {
650
+ if (display == null) return;
651
+
652
+ SetMediaDisplayAlpha(display, 0f);
653
+ display.gameObject.SetActive(false);
654
+ }
655
+
656
+ private void SetMediaDisplayAlpha(RawImage display, float alpha)
657
+ {
658
+ if (display == null) return;
659
+
660
+ Color color = display.color;
661
+ color.a = alpha;
662
+ display.color = color;
663
+ }
664
+
665
+ private void StopMediaDisplayFade()
666
+ {
667
+ if (mediaDisplayFadeCo == null) return;
668
+
669
+ StopCoroutine(mediaDisplayFadeCo);
670
+ mediaDisplayFadeCo = null;
671
+ }
672
+
673
+ private void FadeInMediaDisplay(RawImage display, float delay = 0f)
674
+ {
675
+ if (display == null) return;
676
+
677
+ StopMediaDisplayFade();
678
+ mediaDisplayFadeCo = StartCoroutine(FadeInMediaDisplayCoroutine(display, delay));
679
+ }
680
+
681
+ private IEnumerator FadeInMediaDisplayCoroutine(RawImage display, float delay)
682
+ {
683
+ display.gameObject.SetActive(true);
684
+ SetMediaDisplayAlpha(display, 0f);
685
+
686
+ if (delay > 0f)
687
+ {
688
+ yield return new WaitForSecondsRealtime(delay);
689
+ }
690
+
691
+ float elapsed = 0f;
692
+
693
+ while (elapsed < MediaFadeInDuration)
694
+ {
695
+ if (display == null) yield break;
696
+
697
+ elapsed += Time.unscaledDeltaTime;
698
+ float t = Mathf.Clamp01(elapsed / MediaFadeInDuration);
699
+ SetMediaDisplayAlpha(display, Mathf.SmoothStep(0f, 1f, t));
700
+ yield return null;
701
+ }
702
+
703
+ if (display != null)
704
+ {
705
+ SetMediaDisplayAlpha(display, 1f);
706
+ }
707
+
708
+ mediaDisplayFadeCo = null;
709
+ }
710
+
624
711
 
625
712
 
626
713
  private void DisplayCurrentCard(bool isInitialDisplay)
@@ -628,6 +715,7 @@ namespace Hyper.Internal
628
715
  if (currentCardIndex < 0 || currentCardIndex >= tutorialCards.Count) return;
629
716
 
630
717
  StopVideoPlayback();
718
+ ResetCardMediaState();
631
719
  TutorialCardData card = tutorialCards[currentCardIndex];
632
720
 
633
721
  if (descriptionText != null)
@@ -656,12 +744,7 @@ namespace Hyper.Internal
656
744
  return;
657
745
  }
658
746
 
659
- if (tutorialImageDisplay != null)
660
- tutorialImageDisplay.gameObject.SetActive(false);
661
-
662
- // Start with portrait display as default; will switch to landscape in OnCardVideoPrepared if needed
663
- tutorialDisplayP.gameObject.SetActive(true);
664
- tutorialDisplayL.gameObject.SetActive(false);
747
+ // Keep the media surface hidden while VideoPlayer prepares the next source.
665
748
  currentDisplay = tutorialDisplayP;
666
749
 
667
750
  videoPlayer.enabled = true;
@@ -714,6 +797,7 @@ namespace Hyper.Internal
714
797
  tutorialDisplayP.gameObject.SetActive(targetDisplay == tutorialDisplayP);
715
798
  tutorialDisplayL.gameObject.SetActive(targetDisplay == tutorialDisplayL);
716
799
  currentDisplay = targetDisplay;
800
+ SetMediaDisplayAlpha(currentDisplay, 0f);
717
801
 
718
802
  if (targetTexture != null)
719
803
  {
@@ -733,7 +817,9 @@ namespace Hyper.Internal
733
817
  updateVideoTimeCo = StartCoroutine(UpdateVideoTime());
734
818
 
735
819
  InvokeTutorialLoadingCompleteOnce();
820
+ videoPlayer.time = 0;
736
821
  videoPlayer.Play();
822
+ FadeInMediaDisplay(currentDisplay, VideoRevealDelay);
737
823
  }
738
824
 
739
825
  private void DisplayImageCard(TutorialCardData card, bool isInitialDisplay)
@@ -754,6 +840,7 @@ namespace Hyper.Internal
754
840
 
755
841
  tutorialImageDisplay.gameObject.SetActive(true);
756
842
  tutorialImageDisplay.texture = card.image.texture;
843
+ FadeInMediaDisplay(tutorialImageDisplay);
757
844
 
758
845
  if (isInitialDisplay)
759
846
  {
@@ -781,6 +868,11 @@ namespace Hyper.Internal
781
868
  if (videoPlayer == null) return;
782
869
 
783
870
  videoPlayer.prepareCompleted -= OnCardVideoPrepared;
871
+ videoPlayer.loopPointReached -= OnLoopPointReached;
872
+ if (videoPlayer.isPrepared)
873
+ {
874
+ videoPlayer.time = 0;
875
+ }
784
876
  videoPlayer.Stop();
785
877
  videoPlayer.targetTexture = null;
786
878
  }
@@ -1023,6 +1115,7 @@ namespace Hyper.Internal
1023
1115
  contentRevealScheduled = false;
1024
1116
  isClosing = false;
1025
1117
  CancelHiddenPreloadClose();
1118
+ StopMediaDisplayFade();
1026
1119
  HideTutorialContent();
1027
1120
 
1028
1121
  #if UNITY_EDITOR
@@ -32,7 +32,7 @@ Material:
32
32
  m_Floats:
33
33
  - _ColorMask: 15
34
34
  - _InvertedRadius: 0
35
- - _Radius: 60
35
+ - _Radius: 75
36
36
  - _Softness: 1.75
37
37
  - _Stencil: 0
38
38
  - _StencilComp: 8
@@ -44,10 +44,10 @@ Material:
44
44
  m_Colors:
45
45
  - _ClipRect: {r: -32767, g: -32767, b: 32767, a: 32767}
46
46
  - _Color: {r: 1, g: 1, b: 1, a: 1}
47
- - _CornerRadii: {r: 60, g: 60, b: 0, a: 0}
47
+ - _CornerRadii: {r: 75, g: 75, b: 0, a: 0}
48
48
  - _InvertedCornerRadii: {r: 0, g: 0, b: 962.5, a: 1481.2}
49
49
  - _Pivot: {r: 0.5, g: 0.556, b: 0, a: 0}
50
- - _RectSize: {r: 998, g: 2160, b: 0, a: 0}
50
+ - _RectSize: {r: 2532, g: 1216, b: 0, a: 0}
51
51
  m_BuildTextureStacks: []
52
52
  m_AllowLocking: 1
53
53
  --- !u!114 &4644396538228076653
@@ -184,7 +184,7 @@ RectTransform:
184
184
  m_GameObject: {fileID: 1641685960017025922}
185
185
  m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
186
186
  m_LocalPosition: {x: 0, y: 0, z: 0}
187
- m_LocalScale: {x: 1.25, y: 1.25, z: 1.25}
187
+ m_LocalScale: {x: 1.15, y: 1.15, z: 1.15}
188
188
  m_ConstrainProportionsScale: 1
189
189
  m_Children:
190
190
  - {fileID: 6118213081617822483}
@@ -125,7 +125,7 @@ RectTransform:
125
125
  m_GameObject: {fileID: 936452418214250672}
126
126
  m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
127
127
  m_LocalPosition: {x: 0, y: 0, z: 0}
128
- m_LocalScale: {x: 1.25, y: 1.25, z: 1.25}
128
+ m_LocalScale: {x: 1.15, y: 1.15, z: 1.15}
129
129
  m_ConstrainProportionsScale: 1
130
130
  m_Children:
131
131
  - {fileID: 943448477169687493}
@@ -257,7 +257,7 @@ RectTransform:
257
257
  m_GameObject: {fileID: 936452418214250672}
258
258
  m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
259
259
  m_LocalPosition: {x: 0, y: 0, z: 0}
260
- m_LocalScale: {x: 1.22, y: 1.22, z: 1.22}
260
+ m_LocalScale: {x: 1.15, y: 1.15, z: 1.15}
261
261
  m_ConstrainProportionsScale: 1
262
262
  m_Children:
263
263
  - {fileID: 943448477169687493}