app.hypergames.hypersdk 1.3.4 → 1.4.1

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.
Files changed (86) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/Editor/{HyperSDK.Editor.asmdef → Hyper.Editor.asmdef} +1 -1
  3. package/Editor/Resources/ControlBarPreviews/Dark/Default.png +0 -0
  4. package/Editor/Resources/ControlBarPreviews/Dark/Default.png.meta +143 -0
  5. package/Editor/Resources/ControlBarPreviews/Dark/HealthBarLeft.png +0 -0
  6. package/Editor/Resources/ControlBarPreviews/Dark/HealthBarLeft.png.meta +143 -0
  7. package/Editor/Resources/ControlBarPreviews/Dark/HeartsLeft.png +0 -0
  8. package/Editor/Resources/ControlBarPreviews/Dark/HeartsLeft.png.meta +169 -0
  9. package/Editor/Resources/ControlBarPreviews/Dark.meta +8 -0
  10. package/Editor/Resources/ControlBarPreviews/Light/Default.png +0 -0
  11. package/Editor/Resources/ControlBarPreviews/Light/Default.png.meta +143 -0
  12. package/Editor/Resources/ControlBarPreviews/Light/HealthBarLeft.png +0 -0
  13. package/Editor/Resources/ControlBarPreviews/Light/HealthBarLeft.png.meta +143 -0
  14. package/Editor/Resources/ControlBarPreviews/Light/HeartsLeft.png +0 -0
  15. package/Editor/Resources/ControlBarPreviews/Light/HeartsLeft.png.meta +143 -0
  16. package/Editor/Resources/ControlBarPreviews/Light.meta +8 -0
  17. package/Editor/Resources/ControlBarPreviews.meta +8 -0
  18. package/Editor/Scripts/Inspectors/HyperSDKSettingsEditor.cs +206 -0
  19. package/Editor/Scripts/Inspectors/HyperSDKSettingsEditor.cs.meta +2 -0
  20. package/Editor/Scripts/Inspectors.meta +8 -0
  21. package/Editor/Scripts/Tools/HyperBuildAssistant.cs +53 -3
  22. package/Editor/Scripts/Windows/HyperCoreSettingsWindow.cs +0 -8
  23. package/Editor/Scripts/Windows/HyperGameContentWindow.cs +0 -8
  24. package/Editor/Scripts/Windows/HyperSettingsWindow.cs +3 -3
  25. package/HyperLoader.unity +4 -49
  26. package/Runtime/Internal/AssemblyInfo.cs +1 -1
  27. package/Runtime/Internal/Managers/EventManager.cs +4 -0
  28. package/Runtime/Internal/Managers/GameManager.cs +173 -5
  29. package/Runtime/Internal/ScriptableObjects/HyperSDKSettings.cs +16 -10
  30. package/Runtime/Internal/UI/Animation/BlinkingText.cs +1 -1
  31. package/Runtime/Internal/UI/Animation/HyperTween.cs +88 -0
  32. package/Runtime/Internal/UI/Components/ControlBar.cs +220 -40
  33. package/Runtime/Internal/UI/Components/HealthBarDisplay.cs +269 -0
  34. package/Runtime/Internal/UI/Components/HealthBarDisplay.cs.meta +2 -0
  35. package/Runtime/Internal/UI/Components/LivesDisplay.cs +327 -0
  36. package/Runtime/Internal/UI/Components/LivesDisplay.cs.meta +2 -0
  37. package/Runtime/Internal/UI/Modals/ExitGameMenuModal.cs +46 -0
  38. package/Runtime/Internal/UI/Modals/ExitGameMenuModal.cs.meta +11 -0
  39. package/Runtime/Internal/UI/Modals/StartingInstructionModal.cs +202 -3
  40. package/Runtime/Internal/Utils/HyperConstants.cs +27 -0
  41. package/Runtime/Public/Core/HyperSDK.cs +68 -0
  42. package/Runtime/Resources/Fonts/Wonder Boys/Wonder Boys + Hyper BIG.mat +1 -1
  43. package/Runtime/Resources/Fonts/Wonder Boys/Wonder Boys + Shadows.mat +1 -1
  44. package/Runtime/Resources/HyperSDKSettings.asset +3 -2
  45. package/Runtime/Resources/Sprites/Big Icons/Exit.png +0 -0
  46. package/Runtime/Resources/Sprites/Big Icons/Exit.png.meta +195 -0
  47. package/Runtime/Resources/Sprites/Control Bar/Ellipse 3.png +0 -0
  48. package/Runtime/Resources/Sprites/Control Bar/Ellipse 3.png.meta +169 -0
  49. package/Runtime/Resources/Sprites/Control Bar/Health Bar - Green Fill.png +0 -0
  50. package/Runtime/Resources/Sprites/Control Bar/Health Bar - Green Fill.png.meta +169 -0
  51. package/Runtime/Resources/Sprites/Control Bar/Health Bar - Underlay.png +0 -0
  52. package/Runtime/Resources/Sprites/Control Bar/Health Bar - Underlay.png.meta +169 -0
  53. package/Runtime/Resources/Sprites/Control Bar/Health Bar.png +0 -0
  54. package/Runtime/Resources/Sprites/Control Bar/Health Bar.png.meta +169 -0
  55. package/Runtime/Resources/Sprites/Control Bar/heart.empty.png +0 -0
  56. package/Runtime/Resources/Sprites/Control Bar/heart.empty.png.meta +169 -0
  57. package/Runtime/Resources/Sprites/Control Bar/heart.fill.png +0 -0
  58. package/Runtime/Resources/Sprites/Control Bar/heart.fill.png.meta +169 -0
  59. package/Runtime/Resources/Sprites/Frames/{Game Over P.png.meta → Game Over.png.meta } +4 -4
  60. package/Runtime/Resources/Sprites/HYPERGAMES_Logo.png.meta +3 -3
  61. package/Runtime/Resources/Sprites/Hyper Atlas.spriteatlasv2 +6 -0
  62. package/Runtime/Resources/Sprites/Start CTAs/Hand.PNG +0 -0
  63. package/Runtime/Resources/Sprites/Start CTAs/Hand.PNG.meta +169 -0
  64. package/Runtime/Resources/Sprites/Start CTAs/Line .PNG +0 -0
  65. package/Runtime/Resources/Sprites/Start CTAs/Line .PNG.meta +169 -0
  66. package/Runtime/Resources/Sprites/Start CTAs/Swipe Gesture GIF.controller +130 -0
  67. package/Runtime/Resources/Sprites/Start CTAs/Swipe Gesture GIF.controller.meta +8 -0
  68. package/Runtime/Resources/Sprites/Start CTAs/Swipe Gesture.anim +158 -0
  69. package/Runtime/Resources/Sprites/Start CTAs/Swipe Gesture.anim.meta +8 -0
  70. package/Runtime/Resources/Sprites/Start CTAs.meta +8 -0
  71. package/Runtime/Resources/UIPrefabs/Control Bar Objects/Health Bar Display.prefab +361 -0
  72. package/Runtime/Resources/UIPrefabs/Control Bar Objects/Health Bar Display.prefab.meta +7 -0
  73. package/Runtime/Resources/UIPrefabs/Control Bar Objects/Lives Display .prefab +246 -0
  74. package/Runtime/Resources/UIPrefabs/Control Bar Objects/Lives Display .prefab.meta +7 -0
  75. package/Runtime/Resources/UIPrefabs/Control Bar Objects.meta +8 -0
  76. package/Runtime/Resources/UIPrefabs/ControlBar.prefab +131 -17
  77. package/Runtime/Resources/UIPrefabs/ExitGameMenuModal.prefab +1043 -0
  78. package/Runtime/Resources/UIPrefabs/ExitGameMenuModal.prefab.meta +7 -0
  79. package/Runtime/Resources/UIPrefabs/GamePausedModal_Battle.prefab +1 -1
  80. package/Runtime/Resources/UIPrefabs/StartingInstructionModal.prefab +271 -57
  81. package/Runtime/Resources/UIPrefabs/TutorialLandscapeModal.prefab +1 -1
  82. package/Runtime/Resources/UIPrefabs/TutorialPortraitModal.prefab +1 -1
  83. package/Runtime/Shared/DTOs/Enums.cs +22 -6
  84. package/package.json +1 -1
  85. /package/Editor/{HyperSDK.Editor.asmdef.meta → Hyper.Editor.asmdef.meta} +0 -0
  86. /package/Runtime/Resources/Sprites/Frames/{Game Over P.png → Game Over.png} +0 -0
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.20746, y: -280.1698}
307
+ m_AnchoredPosition: {x: 509.1169, 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
@@ -461,7 +461,6 @@ GameObject:
461
461
  m_Component:
462
462
  - component: {fileID: 894728866}
463
463
  - component: {fileID: 894728865}
464
- - component: {fileID: 894728867}
465
464
  m_Layer: 0
466
465
  m_Name: Main Camera
467
466
  m_TagString: MainCamera
@@ -513,8 +512,8 @@ Camera:
513
512
  m_TargetTexture: {fileID: 0}
514
513
  m_TargetDisplay: 0
515
514
  m_TargetEye: 3
516
- m_HDR: 1
517
- m_AllowMSAA: 1
515
+ m_HDR: 0
516
+ m_AllowMSAA: 0
518
517
  m_AllowDynamicResolution: 0
519
518
  m_ForceIntoRT: 0
520
519
  m_OcclusionCulling: 1
@@ -536,50 +535,6 @@ Transform:
536
535
  - {fileID: 1064166296}
537
536
  m_Father: {fileID: 446519529}
538
537
  m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
539
- --- !u!114 &894728867
540
- MonoBehaviour:
541
- m_ObjectHideFlags: 0
542
- m_CorrespondingSourceObject: {fileID: 0}
543
- m_PrefabInstance: {fileID: 0}
544
- m_PrefabAsset: {fileID: 0}
545
- m_GameObject: {fileID: 894728863}
546
- m_Enabled: 1
547
- m_EditorHideFlags: 0
548
- m_Script: {fileID: 11500000, guid: a79441f348de89743a2939f4d699eac1, type: 3}
549
- m_Name:
550
- m_EditorClassIdentifier:
551
- m_RenderShadows: 1
552
- m_RequiresDepthTextureOption: 2
553
- m_RequiresOpaqueTextureOption: 2
554
- m_CameraType: 0
555
- m_Cameras: []
556
- m_RendererIndex: -1
557
- m_VolumeLayerMask:
558
- serializedVersion: 2
559
- m_Bits: 1
560
- m_VolumeTrigger: {fileID: 0}
561
- m_VolumeFrameworkUpdateModeOption: 2
562
- m_RenderPostProcessing: 0
563
- m_Antialiasing: 0
564
- m_AntialiasingQuality: 2
565
- m_StopNaN: 0
566
- m_Dithering: 0
567
- m_ClearDepth: 1
568
- m_AllowXRRendering: 1
569
- m_AllowHDROutput: 1
570
- m_UseScreenCoordOverride: 0
571
- m_ScreenSizeOverride: {x: 0, y: 0, z: 0, w: 0}
572
- m_ScreenCoordScaleBias: {x: 0, y: 0, z: 0, w: 0}
573
- m_RequiresDepthTexture: 0
574
- m_RequiresColorTexture: 0
575
- m_Version: 2
576
- m_TaaSettings:
577
- m_Quality: 3
578
- m_FrameInfluence: 0.1
579
- m_JitterScale: 1
580
- m_MipBias: 0
581
- m_VarianceClampScale: 0.9
582
- m_ContrastAdaptiveSharpening: 0
583
538
  --- !u!1 &928973802
584
539
  GameObject:
585
540
  m_ObjectHideFlags: 0
@@ -1137,7 +1092,7 @@ RectTransform:
1137
1092
  m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
1138
1093
  m_AnchorMin: {x: 0, y: 1}
1139
1094
  m_AnchorMax: {x: 0, y: 1}
1140
- m_AnchoredPosition: {x: 489.20746, y: -133.2274}
1095
+ m_AnchoredPosition: {x: 509.1169, y: -133.2274}
1141
1096
  m_SizeDelta: {x: 875, y: 54.5378}
1142
1097
  m_Pivot: {x: 0.5, y: 0.5}
1143
1098
  --- !u!1 &2874543288936963705
@@ -1,5 +1,5 @@
1
1
  using System.Runtime.CompilerServices;
2
2
 
3
3
  [assembly: InternalsVisibleTo("Hyper")]
4
- [assembly: InternalsVisibleTo("HyperSDK.Editor")]
4
+ [assembly: InternalsVisibleTo("Hyper.Editor")]
5
5
 
@@ -27,6 +27,8 @@ namespace Hyper.Internal.Managers
27
27
  public event Action OnTimeUp;
28
28
  public event Action OnGameStart;
29
29
  public event Action OnGameEnded;
30
+ public event Action OnLivesExhausted;
31
+ public event Action OnHealthExhausted;
30
32
 
31
33
  #endregion
32
34
 
@@ -56,6 +58,8 @@ namespace Hyper.Internal.Managers
56
58
  internal void InvokeStartDeadlineReachedEvent() => OnStartDeadlineReached?.Invoke();
57
59
  internal void InvokeGameStartEvent() => OnGameStart?.Invoke();
58
60
  internal void InvokeGameEndedEvent() => OnGameEnded?.Invoke();
61
+ internal void InvokeLivesExhaustedEvent() => OnLivesExhausted?.Invoke();
62
+ internal void InvokeHealthExhaustedEvent() => OnHealthExhausted?.Invoke();
59
63
  internal void InvokeConnectionLostEvent() => OnInternetConnectionLost?.Invoke();
60
64
  internal void InvokeConnectionFoundEvent() => OnInternetConnectionFound?.Invoke();
61
65
  internal void InvokeTutorialLoadingCompleteEvent() => OnTutorialLoadingComplete?.Invoke();
@@ -42,6 +42,47 @@ namespace Hyper.Internal.Managers
42
42
  }
43
43
 
44
44
  _isPortrait = Screen.height > Screen.width;
45
+ SubscribeToLivesEvents();
46
+ }
47
+
48
+ private void SubscribeToLivesEvents()
49
+ {
50
+ // Default behavior: automatically end game when lives are exhausted
51
+ // Developers can still subscribe to OnLivesExhausted for custom behavior
52
+ _eventManager.OnLivesExhausted += HandleLivesExhausted;
53
+ _eventManager.OnHealthExhausted += HandleHealthExhausted;
54
+ }
55
+
56
+ private void HandleLivesExhausted()
57
+ {
58
+ if (!IsInGameScene || _hasGameEnded || !_hasGameStarted) return;
59
+
60
+ // Automatically end the game when lives are exhausted
61
+ // Use appropriate method based on game mode
62
+ if (IsBattleMode)
63
+ {
64
+ EndBattleGame();
65
+ }
66
+ else
67
+ {
68
+ EndPracticeGame();
69
+ }
70
+ }
71
+
72
+ private void HandleHealthExhausted()
73
+ {
74
+ if (!IsInGameScene || _hasGameEnded || !_hasGameStarted) return;
75
+
76
+ // Automatically end the game when health is exhausted
77
+ // Use appropriate method based on game mode
78
+ if (IsBattleMode)
79
+ {
80
+ EndBattleGame();
81
+ }
82
+ else
83
+ {
84
+ EndPracticeGame();
85
+ }
45
86
  }
46
87
 
47
88
  internal void Cleanup()
@@ -86,14 +127,14 @@ namespace Hyper.Internal.Managers
86
127
  {
87
128
  ShowGameOverModal();
88
129
  }
89
-
130
+
90
131
  _eventManager.InvokeGameEndedEvent();
91
132
  }
92
133
 
93
134
  public void ExitPracticeMenu()
94
135
  {
95
136
  if (!IsBattleMode)
96
- HyperRuntime.BackendManager.LogEvent(ConsoleEventType.PracticeGameEnd);
137
+ ShowExitGameMenuModal();
97
138
  }
98
139
 
99
140
  #endregion
@@ -107,6 +148,7 @@ namespace Hyper.Internal.Managers
107
148
 
108
149
  internal ControlBarTheme ControlBarTheme { get; private set; }
109
150
  internal ControlBarLayout ControlBarLayout { get; private set; }
151
+ internal StartCTA StartCTA { get; private set; }
110
152
 
111
153
  internal void PauseGame()
112
154
  {
@@ -144,6 +186,90 @@ namespace Hyper.Internal.Managers
144
186
  _controlBarModal?.UpdateScoreLabel();
145
187
  }
146
188
 
189
+ internal void InitializeLives(int maxLives, int initialLives = -1)
190
+ {
191
+ var livesDisplay = _controlBarModal?.GetLivesDisplay();
192
+ livesDisplay?.Initialize(maxLives, initialLives);
193
+ }
194
+
195
+ internal void SetLives(int lives)
196
+ {
197
+ var livesDisplay = _controlBarModal?.GetLivesDisplay();
198
+ livesDisplay?.SetLives(lives);
199
+ }
200
+
201
+ internal void AddLife()
202
+ {
203
+ var livesDisplay = _controlBarModal?.GetLivesDisplay();
204
+ livesDisplay?.AddLife();
205
+ }
206
+
207
+ internal void RemoveLife()
208
+ {
209
+ var livesDisplay = _controlBarModal?.GetLivesDisplay();
210
+ livesDisplay?.RemoveLife();
211
+ }
212
+
213
+ internal int GetCurrentLives()
214
+ {
215
+ var livesDisplay = _controlBarModal?.GetLivesDisplay();
216
+ return livesDisplay?.GetCurrentLives() ?? 0;
217
+ }
218
+
219
+ internal int GetMaxLives()
220
+ {
221
+ var livesDisplay = _controlBarModal?.GetLivesDisplay();
222
+ return livesDisplay?.GetMaxLives() ?? 0;
223
+ }
224
+
225
+ internal void InitializeHealth(float maxHealth, float initialHealth = -1f, bool isNormalized = false)
226
+ {
227
+ var healthBarDisplay = _controlBarModal?.GetHealthBarDisplay();
228
+ healthBarDisplay?.Initialize(maxHealth, initialHealth, isNormalized);
229
+ }
230
+
231
+ internal void SetHealth(float health)
232
+ {
233
+ var healthBarDisplay = _controlBarModal?.GetHealthBarDisplay();
234
+ healthBarDisplay?.SetHealth(health);
235
+ }
236
+
237
+ internal void SetHealthNormalized(float normalizedHealth)
238
+ {
239
+ var healthBarDisplay = _controlBarModal?.GetHealthBarDisplay();
240
+ healthBarDisplay?.SetHealthNormalized(normalizedHealth);
241
+ }
242
+
243
+ internal void AddHealth(float amount)
244
+ {
245
+ var healthBarDisplay = _controlBarModal?.GetHealthBarDisplay();
246
+ healthBarDisplay?.AddHealth(amount);
247
+ }
248
+
249
+ internal void RemoveHealth(float amount)
250
+ {
251
+ var healthBarDisplay = _controlBarModal?.GetHealthBarDisplay();
252
+ healthBarDisplay?.RemoveHealth(amount);
253
+ }
254
+
255
+ internal float GetCurrentHealth()
256
+ {
257
+ var healthBarDisplay = _controlBarModal?.GetHealthBarDisplay();
258
+ return healthBarDisplay?.GetCurrentHealth() ?? 0f;
259
+ }
260
+
261
+ internal float GetMaxHealth()
262
+ {
263
+ var healthBarDisplay = _controlBarModal?.GetHealthBarDisplay();
264
+ return healthBarDisplay?.GetMaxHealth() ?? 0f;
265
+ }
266
+
267
+ internal float GetHealthNormalized()
268
+ {
269
+ var healthBarDisplay = _controlBarModal?.GetHealthBarDisplay();
270
+ return healthBarDisplay?.GetHealthNormalized() ?? 0f;
271
+ }
272
+
147
273
  internal void ShowConnectionLost()
148
274
  {
149
275
  if (!IsInGameScene) return;
@@ -282,6 +408,16 @@ namespace Hyper.Internal.Managers
282
408
  }
283
409
  }
284
410
 
411
+ internal void ShowExitGameMenuModal()
412
+ {
413
+ if (IsInGameScene) return;
414
+
415
+ EnsureExitGameMenuModal();
416
+ _exitGameMenuModal.SetActive(true);
417
+
418
+ SetBlockerActive(true);
419
+ }
420
+
285
421
  internal void ShowGameOverModal()
286
422
  {
287
423
  if (IsBattleMode)
@@ -319,7 +455,7 @@ namespace Hyper.Internal.Managers
319
455
  internal void LoadPracticeMenuScene()
320
456
  {
321
457
  if (!HyperRuntime.GameContent.IsPracticeMenu) return;
322
-
458
+
323
459
  if (HyperRuntime.GameContent.HasTransitionScene)
324
460
  {
325
461
  StartCoroutine(PracticeMenuLoadingCoroutine());
@@ -389,8 +525,9 @@ namespace Hyper.Internal.Managers
389
525
 
390
526
  private void LoadConfiguration()
391
527
  {
392
- ControlBarLayout = HyperRuntime.Settings.topBarLayout;
393
- ControlBarTheme = HyperRuntime.Settings.topBarTheme;
528
+ ControlBarLayout = HyperRuntime.Settings.controlBarLayout;
529
+ ControlBarTheme = HyperRuntime.Settings.controlBarTheme;
530
+ StartCTA = HyperRuntime.Settings.startCTA;
394
531
  }
395
532
 
396
533
  #if UNITY_WEBGL && !UNITY_EDITOR
@@ -757,6 +894,7 @@ namespace Hyper.Internal.Managers
757
894
  private GameObject _startGameDeadlineStatusBar;
758
895
  private GameObject _loadingFailedModal;
759
896
  private GameObject _sessionTimeOutModal;
897
+ private GameObject _exitGameMenuModal;
760
898
  private GameObject _scoreSubmissionFailedModalPortrait;
761
899
  private GameObject _scoreSubmissionFailedModalLandscape;
762
900
  private GameObject _retryTimeExpiredModalPortrait;
@@ -990,6 +1128,30 @@ namespace Hyper.Internal.Managers
990
1128
  _sessionTimeOutModal = InstantiateModal(prefab);
991
1129
  }
992
1130
 
1131
+ private void EnsureExitGameMenuModal()
1132
+ {
1133
+ if (_exitGameMenuModal != null)
1134
+ {
1135
+ _exitGameMenuModal.SetActive(true);
1136
+ return;
1137
+ }
1138
+
1139
+ if (_canvas == null) CreateCanvas();
1140
+
1141
+ GameObject prefab = Resources.Load<GameObject>("UIPrefabs/ExitGameMenuModal");
1142
+ _exitGameMenuModal = InstantiateModal(prefab);
1143
+ }
1144
+
1145
+ internal void HideExitGameMenuModal()
1146
+ {
1147
+ if (_exitGameMenuModal != null && _exitGameMenuModal.activeInHierarchy)
1148
+ {
1149
+ _exitGameMenuModal.SetActive(false);
1150
+ }
1151
+
1152
+ SetBlockerActive(false);
1153
+ }
1154
+
993
1155
  private void EnsureScoreSubmissionFailedModal(bool portrait)
994
1156
  {
995
1157
  if (portrait && _scoreSubmissionFailedModalPortrait != null)
@@ -1268,6 +1430,12 @@ namespace Hyper.Internal.Managers
1268
1430
 
1269
1431
  _startingInstructionModal = instance;
1270
1432
  _startingInstructionModalComponent = instance.GetComponent<StartingInstructionModal>();
1433
+
1434
+ // Configure the CTA text based on settings
1435
+ if (_startingInstructionModalComponent != null)
1436
+ {
1437
+ _startingInstructionModalComponent.Configure(StartCTA);
1438
+ }
1271
1439
  }
1272
1440
 
1273
1441
  private void HideStartingInstructionModal()
@@ -31,24 +31,30 @@ namespace Hyper.Internal
31
31
 
32
32
  #endregion
33
33
 
34
- #region Control Bar Configuration
34
+ #region Start CTA
35
35
 
36
- // [Space(20)]
37
- // [Header("Top Bar Configurations")]
38
- // [Tooltip("Select the color theme (light or dark) for the top bar.")]
39
- [HideInInspector]
40
- public ControlBarTheme topBarTheme = ControlBarTheme.Dark;
36
+ [Space(20)]
37
+ [Header("Start CTA Overlay")]
38
+ [Tooltip("Choose the start CTA overlay shown before gameplay begins. Hyper requires one of these overlays - do not add your own start buttons.")]
39
+ public StartCTA startCTA = StartCTA.TapToPlay;
40
+
41
+ #endregion
42
+
43
+ #region Control Bar Settings
44
+
45
+ [Space(20)]
46
+ [Header("Control Bar Settings")]
47
+ [Tooltip("Select the layout type for the in-game control bar.")]
48
+ public ControlBarLayout controlBarLayout = ControlBarLayout.Default;
41
49
 
42
50
  // [Space(5)]
43
- // [Tooltip("Select the layout type for the in-game top bar.")]
51
+ // [Tooltip("Select the color theme (light or dark) for the control bar.")]
44
52
  [HideInInspector]
45
- public ControlBarLayout topBarLayout = ControlBarLayout.Default;
53
+ public ControlBarTheme controlBarTheme = ControlBarTheme.Dark;
46
54
 
47
55
  #endregion
48
56
 
49
57
  #region Editor Testing
50
-
51
- [Space(10)]
52
58
  [Header("Editor Simulation")]
53
59
  [Tooltip("Configuration settings for testing within the Unity Editor.")]
54
60
  public URLData _settings;
@@ -4,7 +4,7 @@ using TMPro;
4
4
  namespace Hyper.Internal
5
5
  {
6
6
  [RequireComponent(typeof(TMP_Text))]
7
- internal class BlinkText : MonoBehaviour
7
+ internal class BlinkingText : MonoBehaviour
8
8
  {
9
9
  private float blinkSpeed = 6f;
10
10
  private TMP_Text text;
@@ -162,6 +162,34 @@ namespace Hyper.Internal.Animation
162
162
  return handle;
163
163
  }
164
164
 
165
+ /// <summary>
166
+ /// Animates an Image's fillAmount (0-1).
167
+ /// </summary>
168
+ public static TweenHandle DoFillAmount(Image target, float endValue, float duration)
169
+ {
170
+ EnsureCoroutineRunner();
171
+ var handle = new TweenHandle();
172
+ var coroutine = coroutineRunner.StartCoroutine(AnimateFillAmount(target, endValue, duration, handle));
173
+ TrackCoroutine(target, coroutine);
174
+ handle.coroutine = coroutine;
175
+ handle.target = target;
176
+ return handle;
177
+ }
178
+
179
+ /// <summary>
180
+ /// Animates a Transform's local scale.
181
+ /// </summary>
182
+ public static TweenHandle DoScale(Transform target, Vector3 endValue, float duration)
183
+ {
184
+ EnsureCoroutineRunner();
185
+ var handle = new TweenHandle();
186
+ var coroutine = coroutineRunner.StartCoroutine(AnimateScale(target, endValue, duration, handle));
187
+ TrackCoroutine(target, coroutine);
188
+ handle.coroutine = coroutine;
189
+ handle.target = target;
190
+ return handle;
191
+ }
192
+
165
193
  /// <summary>
166
194
  /// Executes a callback after a delay.
167
195
  /// </summary>
@@ -345,6 +373,56 @@ namespace Hyper.Internal.Animation
345
373
  handle.InvokeComplete();
346
374
  }
347
375
 
376
+ private static IEnumerator AnimateFillAmount(Image target, float endValue, float duration, TweenHandle handle)
377
+ {
378
+ float startValue = target.fillAmount;
379
+ float elapsed = 0f;
380
+
381
+ while (elapsed < duration)
382
+ {
383
+ if (target == null)
384
+ {
385
+ UntrackCoroutine(target, handle.coroutine);
386
+ yield break;
387
+ }
388
+
389
+ elapsed += handle.useUnscaledTime ? Time.unscaledDeltaTime : Time.deltaTime;
390
+ float t = Mathf.Clamp01(elapsed / duration);
391
+ float easedT = ApplyEasing(t, handle.ease);
392
+ target.fillAmount = Mathf.Lerp(startValue, endValue, easedT);
393
+ yield return null;
394
+ }
395
+
396
+ target.fillAmount = endValue;
397
+ UntrackCoroutine(target, handle.coroutine);
398
+ handle.InvokeComplete();
399
+ }
400
+
401
+ private static IEnumerator AnimateScale(Transform target, Vector3 endValue, float duration, TweenHandle handle)
402
+ {
403
+ Vector3 startValue = target.localScale;
404
+ float elapsed = 0f;
405
+
406
+ while (elapsed < duration)
407
+ {
408
+ if (target == null)
409
+ {
410
+ UntrackCoroutine(target, handle.coroutine);
411
+ yield break;
412
+ }
413
+
414
+ elapsed += handle.useUnscaledTime ? Time.unscaledDeltaTime : Time.deltaTime;
415
+ float t = Mathf.Clamp01(elapsed / duration);
416
+ float easedT = ApplyEasing(t, handle.ease);
417
+ target.localScale = Vector3.Lerp(startValue, endValue, easedT);
418
+ yield return null;
419
+ }
420
+
421
+ target.localScale = endValue;
422
+ UntrackCoroutine(target, handle.coroutine);
423
+ handle.InvokeComplete();
424
+ }
425
+
348
426
  private static IEnumerator DelayedCallCoroutine(float delay, Action callback, TweenHandle handle)
349
427
  {
350
428
  float elapsed = 0f;
@@ -467,6 +545,16 @@ namespace Hyper.Internal.Animation
467
545
  return HyperTween.DoColor(target, endValue, duration);
468
546
  }
469
547
 
548
+ public static HyperTween.TweenHandle DOFillAmount(this Image target, float endValue, float duration)
549
+ {
550
+ return HyperTween.DoFillAmount(target, endValue, duration);
551
+ }
552
+
553
+ public static HyperTween.TweenHandle DOScale(this Transform target, Vector3 endValue, float duration)
554
+ {
555
+ return HyperTween.DoScale(target, endValue, duration);
556
+ }
557
+
470
558
  public static void DOKill(this Component target)
471
559
  {
472
560
  HyperTween.Kill(target);