app.hypergames.hypersdk 1.3.3 → 1.4.0
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 +15 -0
- package/Editor/{HyperSDK.Editor.asmdef → Hyper.Editor.asmdef} +1 -1
- package/Editor/Resources/ControlBarPreviews/Dark/Default.png +0 -0
- package/Editor/Resources/ControlBarPreviews/Dark/Default.png.meta +143 -0
- package/Editor/Resources/ControlBarPreviews/Dark/HealthBarLeft.png +0 -0
- package/Editor/Resources/ControlBarPreviews/Dark/HealthBarLeft.png.meta +143 -0
- package/Editor/Resources/ControlBarPreviews/Dark/HeartsLeft.png +0 -0
- package/Editor/Resources/ControlBarPreviews/Dark/HeartsLeft.png.meta +169 -0
- package/Editor/Resources/ControlBarPreviews/Dark.meta +8 -0
- package/Editor/Resources/ControlBarPreviews/Light/Default.png +0 -0
- package/Editor/Resources/ControlBarPreviews/Light/Default.png.meta +143 -0
- package/Editor/Resources/ControlBarPreviews/Light/HealthBarLeft.png +0 -0
- package/Editor/Resources/ControlBarPreviews/Light/HealthBarLeft.png.meta +143 -0
- package/Editor/Resources/ControlBarPreviews/Light/HeartsLeft.png +0 -0
- package/Editor/Resources/ControlBarPreviews/Light/HeartsLeft.png.meta +143 -0
- package/Editor/Resources/ControlBarPreviews/Light.meta +8 -0
- package/Editor/Resources/ControlBarPreviews.meta +8 -0
- package/Editor/Scripts/Inspectors/HyperSDKSettingsEditor.cs +206 -0
- package/Editor/Scripts/Inspectors/HyperSDKSettingsEditor.cs.meta +2 -0
- package/Editor/Scripts/Inspectors.meta +8 -0
- package/Editor/Scripts/Windows/HyperCoreSettingsWindow.cs +0 -8
- package/Editor/Scripts/Windows/HyperGameContentWindow.cs +0 -8
- package/Editor/Scripts/Windows/HyperSettingsWindow.cs +3 -3
- package/HyperLoader.unity +4 -49
- package/Runtime/Internal/AssemblyInfo.cs +1 -1
- package/Runtime/Internal/Bootstrap/HyperLoader.cs +2 -0
- package/Runtime/Internal/Core/HyperRuntime.cs +0 -2
- package/Runtime/Internal/Managers/EventManager.cs +4 -0
- package/Runtime/Internal/Managers/GameManager.cs +135 -2
- package/Runtime/Internal/ScriptableObjects/HyperSDKSettings.cs +16 -10
- package/Runtime/Internal/UI/Animation/BlinkingText.cs +1 -1
- package/Runtime/Internal/UI/Animation/HyperTween.cs +88 -0
- package/Runtime/Internal/UI/Components/ControlBar.cs +220 -40
- package/Runtime/Internal/UI/Components/HealthBarDisplay.cs +269 -0
- package/Runtime/Internal/UI/Components/HealthBarDisplay.cs.meta +2 -0
- package/Runtime/Internal/UI/Components/LivesDisplay.cs +327 -0
- package/Runtime/Internal/UI/Components/LivesDisplay.cs.meta +2 -0
- package/Runtime/Internal/UI/Modals/StartingInstructionModal.cs +202 -3
- package/Runtime/Internal/Utils/HyperConstants.cs +27 -0
- package/Runtime/Public/Core/HyperSDK.cs +68 -0
- package/Runtime/Resources/Fonts/Wonder Boys/Wonder Boys + Hyper BIG.mat +1 -1
- package/Runtime/Resources/HyperSDKSettings.asset +3 -2
- package/Runtime/Resources/Sprites/Control Bar/Ellipse 3.png +0 -0
- package/Runtime/Resources/Sprites/Control Bar/Ellipse 3.png.meta +169 -0
- package/Runtime/Resources/Sprites/Control Bar/Health Bar - Green Fill.png +0 -0
- package/Runtime/Resources/Sprites/Control Bar/Health Bar - Green Fill.png.meta +169 -0
- package/Runtime/Resources/Sprites/Control Bar/Health Bar - Underlay.png +0 -0
- package/Runtime/Resources/Sprites/Control Bar/Health Bar - Underlay.png.meta +169 -0
- package/Runtime/Resources/Sprites/Control Bar/Health Bar.png +0 -0
- package/Runtime/Resources/Sprites/Control Bar/Health Bar.png.meta +169 -0
- package/Runtime/Resources/Sprites/Control Bar/heart.empty.png +0 -0
- package/Runtime/Resources/Sprites/Control Bar/heart.empty.png.meta +169 -0
- package/Runtime/Resources/Sprites/Control Bar/heart.fill.png +0 -0
- package/Runtime/Resources/Sprites/Control Bar/heart.fill.png.meta +169 -0
- package/Runtime/Resources/Sprites/Frames/{Game Over P.png.meta → Game Over.png.meta } +4 -4
- package/Runtime/Resources/Sprites/HYPERGAMES_Logo.png.meta +3 -3
- package/Runtime/Resources/Sprites/Hyper Atlas.spriteatlasv2 +6 -0
- package/Runtime/Resources/Sprites/Start CTAs/Hand.PNG +0 -0
- package/Runtime/Resources/Sprites/Start CTAs/Hand.PNG.meta +169 -0
- package/Runtime/Resources/Sprites/Start CTAs/Line .PNG +0 -0
- package/Runtime/Resources/Sprites/Start CTAs/Line .PNG.meta +169 -0
- package/Runtime/Resources/Sprites/Start CTAs/Swipe Gesture GIF.controller +130 -0
- package/Runtime/Resources/Sprites/Start CTAs/Swipe Gesture GIF.controller.meta +8 -0
- package/Runtime/Resources/Sprites/Start CTAs/Swipe Gesture.anim +158 -0
- package/Runtime/Resources/Sprites/Start CTAs/Swipe Gesture.anim.meta +8 -0
- package/Runtime/Resources/Sprites/Start CTAs.meta +8 -0
- package/Runtime/Resources/UIPrefabs/Control Bar Objects/Health Bar Display.prefab +361 -0
- package/Runtime/Resources/UIPrefabs/Control Bar Objects/Health Bar Display.prefab.meta +7 -0
- package/Runtime/Resources/UIPrefabs/Control Bar Objects/Lives Display .prefab +246 -0
- package/Runtime/Resources/UIPrefabs/Control Bar Objects/Lives Display .prefab.meta +7 -0
- package/Runtime/Resources/UIPrefabs/Control Bar Objects.meta +8 -0
- package/Runtime/Resources/UIPrefabs/ControlBar.prefab +131 -17
- package/Runtime/Resources/UIPrefabs/StartingInstructionModal.prefab +271 -57
- package/Runtime/Resources/UIPrefabs/TutorialLandscapeModal.prefab +1 -1
- package/Runtime/Resources/UIPrefabs/TutorialPortraitModal.prefab +1 -1
- package/Runtime/Shared/DTOs/Enums.cs +22 -6
- package/package.json +1 -1
- /package/Editor/{HyperSDK.Editor.asmdef.meta → Hyper.Editor.asmdef.meta} +0 -0
- /package/Runtime/Resources/Sprites/Frames/{Game Over P.png → Game Over.png} +0 -0
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
using System.Runtime.InteropServices;
|
|
2
2
|
using Hyper.Internal.Managers;
|
|
3
|
+
using Hyper.Shared;
|
|
4
|
+
using TMPro;
|
|
3
5
|
using UnityEngine;
|
|
6
|
+
using UnityEngine.UI;
|
|
4
7
|
|
|
5
8
|
namespace Hyper.Internal
|
|
6
9
|
{
|
|
@@ -11,10 +14,19 @@ namespace Hyper.Internal
|
|
|
11
14
|
[DllImport("__Internal")]
|
|
12
15
|
private static extern void MarkGameStartedOnHTML();
|
|
13
16
|
#endif
|
|
17
|
+
[SerializeField] private TextMeshProUGUI startCtaLabel;
|
|
18
|
+
[SerializeField] private BlinkingText blinkingText;
|
|
19
|
+
[SerializeField] private RectTransform swipeGif;
|
|
14
20
|
private EventManager _eventManager;
|
|
15
21
|
private DataManager _dataManager;
|
|
16
22
|
private GameManager _gameManager;
|
|
17
23
|
private BackendManager _backendManager;
|
|
24
|
+
private StartCTA _currentCTA;
|
|
25
|
+
|
|
26
|
+
// Swipe detection variables
|
|
27
|
+
private Vector2 _swipeStartPosition;
|
|
28
|
+
private bool _isTrackingSwipe;
|
|
29
|
+
private const float SWIPE_THRESHOLD = 50f; // Minimum distance in pixels for a swipe
|
|
18
30
|
|
|
19
31
|
void Awake()
|
|
20
32
|
{
|
|
@@ -24,10 +36,155 @@ namespace Hyper.Internal
|
|
|
24
36
|
_backendManager = HyperRuntime.BackendManager;
|
|
25
37
|
}
|
|
26
38
|
|
|
27
|
-
|
|
39
|
+
void Update()
|
|
40
|
+
{
|
|
41
|
+
if (!gameObject.activeSelf) return;
|
|
42
|
+
|
|
43
|
+
if (_currentCTA == StartCTA.TapToPlay)
|
|
44
|
+
{
|
|
45
|
+
HandleTapInput();
|
|
46
|
+
}
|
|
47
|
+
else
|
|
48
|
+
{
|
|
49
|
+
HandleSwipeInput();
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/// <summary>
|
|
54
|
+
/// Configures the CTA text and input mode based on the selected StartCTA type.
|
|
55
|
+
/// </summary>
|
|
56
|
+
public void Configure(StartCTA cta)
|
|
57
|
+
{
|
|
58
|
+
_currentCTA = cta;
|
|
59
|
+
|
|
60
|
+
if (startCtaLabel == null)
|
|
61
|
+
{
|
|
62
|
+
// Fallback: try to find it if not assigned
|
|
63
|
+
startCtaLabel = GetComponentInChildren<TextMeshProUGUI>();
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
if (startCtaLabel == null)
|
|
67
|
+
{
|
|
68
|
+
HyperDebug.LogWarning("[StartingInstructionModal] Start CTA label not found. Make sure the TextMeshProUGUI component is assigned in the prefab.");
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
switch (cta)
|
|
73
|
+
{
|
|
74
|
+
case StartCTA.SwipeToPlayVertical:
|
|
75
|
+
case StartCTA.SwipeToPlayHorizontal:
|
|
76
|
+
startCtaLabel.text = "SWIPE TO PLAY";
|
|
77
|
+
blinkingText.enabled = false;
|
|
78
|
+
break;
|
|
79
|
+
case StartCTA.TapToPlay:
|
|
80
|
+
default:
|
|
81
|
+
startCtaLabel.text = "TAP TO PLAY";
|
|
82
|
+
blinkingText.enabled = true;
|
|
83
|
+
break;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
UpdateSwipeGraphics();
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/// <summary>
|
|
90
|
+
/// Handles tap input detection (works with both old and new Input System).
|
|
91
|
+
/// </summary>
|
|
92
|
+
private void HandleTapInput()
|
|
93
|
+
{
|
|
94
|
+
bool tapDetected = false;
|
|
95
|
+
|
|
96
|
+
// Check mouse input (works in editor and desktop)
|
|
97
|
+
if (Input.GetMouseButtonDown(0))
|
|
98
|
+
{
|
|
99
|
+
tapDetected = true;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
// Check touch input (works on mobile and WebGL)
|
|
103
|
+
if (Input.touchCount > 0)
|
|
104
|
+
{
|
|
105
|
+
Touch touch = Input.GetTouch(0);
|
|
106
|
+
if (touch.phase == TouchPhase.Began)
|
|
107
|
+
{
|
|
108
|
+
tapDetected = true;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
if (tapDetected)
|
|
113
|
+
{
|
|
114
|
+
StartGame();
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/// <summary>
|
|
119
|
+
/// Handles swipe input detection (works with both old and new Input System).
|
|
120
|
+
/// </summary>
|
|
121
|
+
private void HandleSwipeInput()
|
|
122
|
+
{
|
|
123
|
+
bool swipeDetected = false;
|
|
124
|
+
Vector2 currentPosition = Vector2.zero;
|
|
125
|
+
|
|
126
|
+
// Check mouse input (works in editor and desktop)
|
|
127
|
+
if (Input.GetMouseButtonDown(0))
|
|
128
|
+
{
|
|
129
|
+
_swipeStartPosition = Input.mousePosition;
|
|
130
|
+
_isTrackingSwipe = true;
|
|
131
|
+
}
|
|
132
|
+
else if (Input.GetMouseButton(0) && _isTrackingSwipe)
|
|
133
|
+
{
|
|
134
|
+
currentPosition = Input.mousePosition;
|
|
135
|
+
Vector2 delta = currentPosition - _swipeStartPosition;
|
|
136
|
+
|
|
137
|
+
if (IsSwipeDirectionValid(delta))
|
|
138
|
+
{
|
|
139
|
+
swipeDetected = true;
|
|
140
|
+
_isTrackingSwipe = false;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
else if (Input.GetMouseButtonUp(0))
|
|
144
|
+
{
|
|
145
|
+
_isTrackingSwipe = false;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
// Check touch input (works on mobile and WebGL)
|
|
149
|
+
if (Input.touchCount > 0)
|
|
150
|
+
{
|
|
151
|
+
Touch touch = Input.GetTouch(0);
|
|
152
|
+
|
|
153
|
+
if (touch.phase == TouchPhase.Began)
|
|
154
|
+
{
|
|
155
|
+
_swipeStartPosition = touch.position;
|
|
156
|
+
_isTrackingSwipe = true;
|
|
157
|
+
}
|
|
158
|
+
else if (touch.phase == TouchPhase.Moved && _isTrackingSwipe)
|
|
159
|
+
{
|
|
160
|
+
currentPosition = touch.position;
|
|
161
|
+
Vector2 delta = currentPosition - _swipeStartPosition;
|
|
162
|
+
|
|
163
|
+
if (IsSwipeDirectionValid(delta))
|
|
164
|
+
{
|
|
165
|
+
swipeDetected = true;
|
|
166
|
+
_isTrackingSwipe = false;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
else if (touch.phase == TouchPhase.Ended || touch.phase == TouchPhase.Canceled)
|
|
170
|
+
{
|
|
171
|
+
_isTrackingSwipe = false;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
if (swipeDetected)
|
|
176
|
+
{
|
|
177
|
+
StartGame();
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
/// <summary>
|
|
182
|
+
/// Starts the game - called when tap or swipe is detected.
|
|
183
|
+
/// </summary>
|
|
184
|
+
private void StartGame()
|
|
28
185
|
{
|
|
29
186
|
_gameManager.HideStartGameDeadlineSnackBar();
|
|
30
|
-
|
|
187
|
+
_dataManager.UpdateScore(0);
|
|
31
188
|
HyperRuntime.Timer.StartActiveGameTimer();
|
|
32
189
|
|
|
33
190
|
// Only proceed if connected
|
|
@@ -39,10 +196,52 @@ namespace Hyper.Internal
|
|
|
39
196
|
}
|
|
40
197
|
|
|
41
198
|
#if UNITY_WEBGL && !UNITY_EDITOR
|
|
42
|
-
|
|
199
|
+
MarkGameStartedOnHTML();
|
|
43
200
|
#endif
|
|
44
201
|
_eventManager.InvokeGameStartEvent();
|
|
45
202
|
gameObject.SetActive(false);
|
|
46
203
|
}
|
|
204
|
+
|
|
205
|
+
private void UpdateSwipeGraphics()
|
|
206
|
+
{
|
|
207
|
+
bool showVertical = _currentCTA == StartCTA.SwipeToPlayVertical;
|
|
208
|
+
bool showHorizontal = _currentCTA == StartCTA.SwipeToPlayHorizontal;
|
|
209
|
+
|
|
210
|
+
if (swipeGif != null)
|
|
211
|
+
{
|
|
212
|
+
if (showVertical)
|
|
213
|
+
{
|
|
214
|
+
swipeGif.anchoredPosition = new Vector3(0, 286, 0);
|
|
215
|
+
swipeGif.transform.rotation = Quaternion.Euler(0, 0, 90);
|
|
216
|
+
swipeGif.gameObject.SetActive(true);
|
|
217
|
+
}
|
|
218
|
+
else if (showHorizontal)
|
|
219
|
+
{
|
|
220
|
+
swipeGif.anchoredPosition = new Vector3(0, 220, 0);
|
|
221
|
+
swipeGif.transform.rotation = Quaternion.Euler(0, 0, 0);
|
|
222
|
+
swipeGif.gameObject.SetActive(true);
|
|
223
|
+
}
|
|
224
|
+
else
|
|
225
|
+
{
|
|
226
|
+
swipeGif.gameObject.SetActive(false);
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
private bool IsSwipeDirectionValid(Vector2 delta)
|
|
232
|
+
{
|
|
233
|
+
float absX = Mathf.Abs(delta.x);
|
|
234
|
+
float absY = Mathf.Abs(delta.y);
|
|
235
|
+
|
|
236
|
+
switch (_currentCTA)
|
|
237
|
+
{
|
|
238
|
+
case StartCTA.SwipeToPlayVertical:
|
|
239
|
+
return absY >= SWIPE_THRESHOLD && absY >= absX;
|
|
240
|
+
case StartCTA.SwipeToPlayHorizontal:
|
|
241
|
+
return absX >= SWIPE_THRESHOLD && absX >= absY;
|
|
242
|
+
default:
|
|
243
|
+
return false;
|
|
244
|
+
}
|
|
245
|
+
}
|
|
47
246
|
}
|
|
48
247
|
}
|
|
@@ -65,6 +65,33 @@ namespace Hyper.Internal
|
|
|
65
65
|
return devPath;
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
|
+
|
|
69
|
+
/// <summary>
|
|
70
|
+
/// Returns the control bar preview folder path, checking dev mode (Assets/) first, then package mode (Packages/).
|
|
71
|
+
/// </summary>
|
|
72
|
+
public static string CONTROL_BAR_PREVIEW_FOLDER_PATH
|
|
73
|
+
{
|
|
74
|
+
get
|
|
75
|
+
{
|
|
76
|
+
const string devPath = "Assets/HyperSDK/Editor/Resources/ControlBarPreviews";
|
|
77
|
+
const string packagePath = "Packages/app.hypergames.hypersdk/Editor/Resources/ControlBarPreviews";
|
|
78
|
+
|
|
79
|
+
// Check dev mode first (Assets/)
|
|
80
|
+
if (AssetDatabase.IsValidFolder(devPath))
|
|
81
|
+
{
|
|
82
|
+
return devPath;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
// Fall back to package mode (Packages/)
|
|
86
|
+
if (AssetDatabase.IsValidFolder(packagePath))
|
|
87
|
+
{
|
|
88
|
+
return packagePath;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
// Default to dev path if neither found (for backwards compatibility)
|
|
92
|
+
return devPath;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
68
95
|
#endif
|
|
69
96
|
|
|
70
97
|
#endregion
|
|
@@ -130,6 +130,24 @@ namespace Hyper
|
|
|
130
130
|
void EndBattleGame();
|
|
131
131
|
void EndPracticeGame();
|
|
132
132
|
void ExitPracticeMenu();
|
|
133
|
+
|
|
134
|
+
// Lives Management (only available when ControlBarLayout is HeartsLeft)
|
|
135
|
+
void InitializeLives(int maxLives, int initialLives = -1);
|
|
136
|
+
void SetLives(int lives);
|
|
137
|
+
void AddLife();
|
|
138
|
+
void RemoveLife();
|
|
139
|
+
int GetCurrentLives();
|
|
140
|
+
int GetMaxLives();
|
|
141
|
+
|
|
142
|
+
// Health Management (only available when ControlBarLayout is HealthBarGreenLeft)
|
|
143
|
+
void InitializeHealth(float maxHealth, float initialHealth = -1f, bool isNormalized = false);
|
|
144
|
+
void SetHealth(float health);
|
|
145
|
+
void SetHealthNormalized(float normalizedHealth);
|
|
146
|
+
void AddHealth(float amount);
|
|
147
|
+
void RemoveHealth(float amount);
|
|
148
|
+
float GetCurrentHealth();
|
|
149
|
+
float GetMaxHealth();
|
|
150
|
+
float GetHealthNormalized();
|
|
133
151
|
}
|
|
134
152
|
|
|
135
153
|
/// <summary>
|
|
@@ -158,6 +176,8 @@ namespace Hyper
|
|
|
158
176
|
event Action OnGameResumed;
|
|
159
177
|
event Action OnGameEnded;
|
|
160
178
|
event Action<bool> OnSoundChanged;
|
|
179
|
+
event Action OnLivesExhausted;
|
|
180
|
+
event Action OnHealthExhausted;
|
|
161
181
|
}
|
|
162
182
|
|
|
163
183
|
#region Adapter Implementations
|
|
@@ -178,6 +198,22 @@ namespace Hyper
|
|
|
178
198
|
public void EndBattleGame() => Manager?.EndBattleGame();
|
|
179
199
|
public void EndPracticeGame() => Manager?.EndPracticeGame();
|
|
180
200
|
public void ExitPracticeMenu() => Manager?.ExitPracticeMenu();
|
|
201
|
+
|
|
202
|
+
public void InitializeLives(int maxLives, int initialLives = -1) => Manager?.InitializeLives(maxLives, initialLives);
|
|
203
|
+
public void SetLives(int lives) => Manager?.SetLives(lives);
|
|
204
|
+
public void AddLife() => Manager?.AddLife();
|
|
205
|
+
public void RemoveLife() => Manager?.RemoveLife();
|
|
206
|
+
public int GetCurrentLives() => Manager?.GetCurrentLives() ?? 0;
|
|
207
|
+
public int GetMaxLives() => Manager?.GetMaxLives() ?? 0;
|
|
208
|
+
|
|
209
|
+
public void InitializeHealth(float maxHealth, float initialHealth = -1f, bool isNormalized = false) => Manager?.InitializeHealth(maxHealth, initialHealth, isNormalized);
|
|
210
|
+
public void SetHealth(float health) => Manager?.SetHealth(health);
|
|
211
|
+
public void SetHealthNormalized(float normalizedHealth) => Manager?.SetHealthNormalized(normalizedHealth);
|
|
212
|
+
public void AddHealth(float amount) => Manager?.AddHealth(amount);
|
|
213
|
+
public void RemoveHealth(float amount) => Manager?.RemoveHealth(amount);
|
|
214
|
+
public float GetCurrentHealth() => Manager?.GetCurrentHealth() ?? 0f;
|
|
215
|
+
public float GetMaxHealth() => Manager?.GetMaxHealth() ?? 0f;
|
|
216
|
+
public float GetHealthNormalized() => Manager?.GetHealthNormalized() ?? 0f;
|
|
181
217
|
}
|
|
182
218
|
|
|
183
219
|
/// <summary>
|
|
@@ -210,6 +246,8 @@ namespace Hyper
|
|
|
210
246
|
private Action _onGameResumed;
|
|
211
247
|
private Action _onGameEnded;
|
|
212
248
|
private Action<bool> _onSoundChanged;
|
|
249
|
+
private Action _onLivesExhausted;
|
|
250
|
+
private Action _onHealthExhausted;
|
|
213
251
|
|
|
214
252
|
private Action _gameStartBridge;
|
|
215
253
|
private Action _timeUpBridge;
|
|
@@ -217,6 +255,8 @@ namespace Hyper
|
|
|
217
255
|
private Action _gameResumedBridge;
|
|
218
256
|
private Action _gameEndedBridge;
|
|
219
257
|
private Action<bool> _soundChangedBridge;
|
|
258
|
+
private Action _livesExhaustedBridge;
|
|
259
|
+
private Action _healthExhaustedBridge;
|
|
220
260
|
|
|
221
261
|
public event Action OnGameStart
|
|
222
262
|
{
|
|
@@ -278,6 +318,26 @@ namespace Hyper
|
|
|
278
318
|
remove => _onSoundChanged -= value;
|
|
279
319
|
}
|
|
280
320
|
|
|
321
|
+
public event Action OnLivesExhausted
|
|
322
|
+
{
|
|
323
|
+
add
|
|
324
|
+
{
|
|
325
|
+
_onLivesExhausted += value;
|
|
326
|
+
RefreshBindings();
|
|
327
|
+
}
|
|
328
|
+
remove => _onLivesExhausted -= value;
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
public event Action OnHealthExhausted
|
|
332
|
+
{
|
|
333
|
+
add
|
|
334
|
+
{
|
|
335
|
+
_onHealthExhausted += value;
|
|
336
|
+
RefreshBindings();
|
|
337
|
+
}
|
|
338
|
+
remove => _onHealthExhausted -= value;
|
|
339
|
+
}
|
|
340
|
+
|
|
281
341
|
internal void RefreshBindings()
|
|
282
342
|
{
|
|
283
343
|
var manager = HyperRuntime.EventManager;
|
|
@@ -304,6 +364,8 @@ namespace Hyper
|
|
|
304
364
|
_gameResumedBridge = () => _onGameResumed?.Invoke();
|
|
305
365
|
_gameEndedBridge = () => _onGameEnded?.Invoke();
|
|
306
366
|
_soundChangedBridge = enabled => _onSoundChanged?.Invoke(enabled);
|
|
367
|
+
_livesExhaustedBridge = () => _onLivesExhausted?.Invoke();
|
|
368
|
+
_healthExhaustedBridge = () => _onHealthExhausted?.Invoke();
|
|
307
369
|
|
|
308
370
|
manager.OnGameStart += _gameStartBridge;
|
|
309
371
|
manager.OnTimeUp += _timeUpBridge;
|
|
@@ -311,6 +373,8 @@ namespace Hyper
|
|
|
311
373
|
manager.OnGameResumed += _gameResumedBridge;
|
|
312
374
|
manager.OnGameEnded += _gameEndedBridge;
|
|
313
375
|
manager.OnSoundChanged += _soundChangedBridge;
|
|
376
|
+
manager.OnLivesExhausted += _livesExhaustedBridge;
|
|
377
|
+
manager.OnHealthExhausted += _healthExhaustedBridge;
|
|
314
378
|
|
|
315
379
|
_attachedManager = manager;
|
|
316
380
|
}
|
|
@@ -328,6 +392,8 @@ namespace Hyper
|
|
|
328
392
|
if (_gameResumedBridge != null) _attachedManager.OnGameResumed -= _gameResumedBridge;
|
|
329
393
|
if (_gameEndedBridge != null) _attachedManager.OnGameEnded -= _gameEndedBridge;
|
|
330
394
|
if (_soundChangedBridge != null) _attachedManager.OnSoundChanged -= _soundChangedBridge;
|
|
395
|
+
if (_livesExhaustedBridge != null) _attachedManager.OnLivesExhausted -= _livesExhaustedBridge;
|
|
396
|
+
if (_healthExhaustedBridge != null) _attachedManager.OnHealthExhausted -= _healthExhaustedBridge;
|
|
331
397
|
|
|
332
398
|
_gameStartBridge = null;
|
|
333
399
|
_timeUpBridge = null;
|
|
@@ -335,6 +401,8 @@ namespace Hyper
|
|
|
335
401
|
_gameResumedBridge = null;
|
|
336
402
|
_gameEndedBridge = null;
|
|
337
403
|
_soundChangedBridge = null;
|
|
404
|
+
_livesExhaustedBridge = null;
|
|
405
|
+
_healthExhaustedBridge = null;
|
|
338
406
|
_attachedManager = null;
|
|
339
407
|
}
|
|
340
408
|
}
|
|
@@ -100,7 +100,7 @@ Material:
|
|
|
100
100
|
m_Colors:
|
|
101
101
|
- _ClipRect: {r: -32767, g: -32767, b: 32767, a: 32767}
|
|
102
102
|
- _EnvMatrixRotation: {r: 0, g: 0, b: 0, a: 0}
|
|
103
|
-
- _FaceColor: {r: 1, g:
|
|
103
|
+
- _FaceColor: {r: 1, g: 1, b: 1, a: 1}
|
|
104
104
|
- _GlowColor: {r: 0, g: 1, b: 0, a: 0.5}
|
|
105
105
|
- _MaskCoord: {r: 0, g: 0, b: 32767, a: 32767}
|
|
106
106
|
- _OutlineColor: {r: 0, g: 0, b: 0, a: 1}
|
|
Binary file
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
fileFormatVersion: 2
|
|
2
|
+
guid: 61135c9058b858e45b9fab81b52d9302
|
|
3
|
+
TextureImporter:
|
|
4
|
+
internalIDToNameTable:
|
|
5
|
+
- first:
|
|
6
|
+
213: 6168737785598421730
|
|
7
|
+
second: Ellipse 3_0
|
|
8
|
+
externalObjects: {}
|
|
9
|
+
serializedVersion: 13
|
|
10
|
+
mipmaps:
|
|
11
|
+
mipMapMode: 0
|
|
12
|
+
enableMipMap: 0
|
|
13
|
+
sRGBTexture: 1
|
|
14
|
+
linearTexture: 0
|
|
15
|
+
fadeOut: 0
|
|
16
|
+
borderMipMap: 0
|
|
17
|
+
mipMapsPreserveCoverage: 0
|
|
18
|
+
alphaTestReferenceValue: 0.5
|
|
19
|
+
mipMapFadeDistanceStart: 1
|
|
20
|
+
mipMapFadeDistanceEnd: 3
|
|
21
|
+
bumpmap:
|
|
22
|
+
convertToNormalMap: 0
|
|
23
|
+
externalNormalMap: 0
|
|
24
|
+
heightScale: 0.25
|
|
25
|
+
normalMapFilter: 0
|
|
26
|
+
flipGreenChannel: 0
|
|
27
|
+
isReadable: 0
|
|
28
|
+
streamingMipmaps: 0
|
|
29
|
+
streamingMipmapsPriority: 0
|
|
30
|
+
vTOnly: 0
|
|
31
|
+
ignoreMipmapLimit: 0
|
|
32
|
+
grayScaleToAlpha: 0
|
|
33
|
+
generateCubemap: 6
|
|
34
|
+
cubemapConvolution: 0
|
|
35
|
+
seamlessCubemap: 0
|
|
36
|
+
textureFormat: 1
|
|
37
|
+
maxTextureSize: 2048
|
|
38
|
+
textureSettings:
|
|
39
|
+
serializedVersion: 2
|
|
40
|
+
filterMode: 1
|
|
41
|
+
aniso: 1
|
|
42
|
+
mipBias: 0
|
|
43
|
+
wrapU: 1
|
|
44
|
+
wrapV: 1
|
|
45
|
+
wrapW: 1
|
|
46
|
+
nPOTScale: 0
|
|
47
|
+
lightmap: 0
|
|
48
|
+
compressionQuality: 50
|
|
49
|
+
spriteMode: 2
|
|
50
|
+
spriteExtrude: 1
|
|
51
|
+
spriteMeshType: 1
|
|
52
|
+
alignment: 0
|
|
53
|
+
spritePivot: {x: 0.5, y: 0.5}
|
|
54
|
+
spritePixelsToUnits: 100
|
|
55
|
+
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
|
56
|
+
spriteGenerateFallbackPhysicsShape: 1
|
|
57
|
+
alphaUsage: 1
|
|
58
|
+
alphaIsTransparency: 1
|
|
59
|
+
spriteTessellationDetail: -1
|
|
60
|
+
textureType: 8
|
|
61
|
+
textureShape: 1
|
|
62
|
+
singleChannelComponent: 0
|
|
63
|
+
flipbookRows: 1
|
|
64
|
+
flipbookColumns: 1
|
|
65
|
+
maxTextureSizeSet: 0
|
|
66
|
+
compressionQualitySet: 0
|
|
67
|
+
textureFormatSet: 0
|
|
68
|
+
ignorePngGamma: 0
|
|
69
|
+
applyGammaDecoding: 0
|
|
70
|
+
swizzle: 50462976
|
|
71
|
+
cookieLightType: 0
|
|
72
|
+
platformSettings:
|
|
73
|
+
- serializedVersion: 4
|
|
74
|
+
buildTarget: DefaultTexturePlatform
|
|
75
|
+
maxTextureSize: 2048
|
|
76
|
+
resizeAlgorithm: 0
|
|
77
|
+
textureFormat: -1
|
|
78
|
+
textureCompression: 1
|
|
79
|
+
compressionQuality: 50
|
|
80
|
+
crunchedCompression: 0
|
|
81
|
+
allowsAlphaSplitting: 0
|
|
82
|
+
overridden: 0
|
|
83
|
+
ignorePlatformSupport: 0
|
|
84
|
+
androidETC2FallbackOverride: 0
|
|
85
|
+
forceMaximumCompressionQuality_BC6H_BC7: 0
|
|
86
|
+
- serializedVersion: 4
|
|
87
|
+
buildTarget: Standalone
|
|
88
|
+
maxTextureSize: 2048
|
|
89
|
+
resizeAlgorithm: 0
|
|
90
|
+
textureFormat: -1
|
|
91
|
+
textureCompression: 1
|
|
92
|
+
compressionQuality: 50
|
|
93
|
+
crunchedCompression: 0
|
|
94
|
+
allowsAlphaSplitting: 0
|
|
95
|
+
overridden: 0
|
|
96
|
+
ignorePlatformSupport: 0
|
|
97
|
+
androidETC2FallbackOverride: 0
|
|
98
|
+
forceMaximumCompressionQuality_BC6H_BC7: 0
|
|
99
|
+
- serializedVersion: 4
|
|
100
|
+
buildTarget: Android
|
|
101
|
+
maxTextureSize: 2048
|
|
102
|
+
resizeAlgorithm: 0
|
|
103
|
+
textureFormat: -1
|
|
104
|
+
textureCompression: 1
|
|
105
|
+
compressionQuality: 50
|
|
106
|
+
crunchedCompression: 0
|
|
107
|
+
allowsAlphaSplitting: 0
|
|
108
|
+
overridden: 0
|
|
109
|
+
ignorePlatformSupport: 0
|
|
110
|
+
androidETC2FallbackOverride: 0
|
|
111
|
+
forceMaximumCompressionQuality_BC6H_BC7: 0
|
|
112
|
+
- serializedVersion: 4
|
|
113
|
+
buildTarget: WebGL
|
|
114
|
+
maxTextureSize: 2048
|
|
115
|
+
resizeAlgorithm: 0
|
|
116
|
+
textureFormat: -1
|
|
117
|
+
textureCompression: 1
|
|
118
|
+
compressionQuality: 50
|
|
119
|
+
crunchedCompression: 0
|
|
120
|
+
allowsAlphaSplitting: 0
|
|
121
|
+
overridden: 0
|
|
122
|
+
ignorePlatformSupport: 0
|
|
123
|
+
androidETC2FallbackOverride: 0
|
|
124
|
+
forceMaximumCompressionQuality_BC6H_BC7: 0
|
|
125
|
+
spriteSheet:
|
|
126
|
+
serializedVersion: 2
|
|
127
|
+
sprites:
|
|
128
|
+
- serializedVersion: 2
|
|
129
|
+
name: Ellipse 3_0
|
|
130
|
+
rect:
|
|
131
|
+
serializedVersion: 2
|
|
132
|
+
x: 0
|
|
133
|
+
y: 0
|
|
134
|
+
width: 22
|
|
135
|
+
height: 17
|
|
136
|
+
alignment: 0
|
|
137
|
+
pivot: {x: 0, y: 0}
|
|
138
|
+
border: {x: 0, y: 0, z: 0, w: 0}
|
|
139
|
+
customData:
|
|
140
|
+
outline: []
|
|
141
|
+
physicsShape: []
|
|
142
|
+
tessellationDetail: -1
|
|
143
|
+
bones: []
|
|
144
|
+
spriteID: 2eaaf172552cb9550800000000000000
|
|
145
|
+
internalID: 6168737785598421730
|
|
146
|
+
vertices: []
|
|
147
|
+
indices:
|
|
148
|
+
edges: []
|
|
149
|
+
weights: []
|
|
150
|
+
outline: []
|
|
151
|
+
customData:
|
|
152
|
+
physicsShape: []
|
|
153
|
+
bones: []
|
|
154
|
+
spriteID:
|
|
155
|
+
internalID: 0
|
|
156
|
+
vertices: []
|
|
157
|
+
indices:
|
|
158
|
+
edges: []
|
|
159
|
+
weights: []
|
|
160
|
+
secondaryTextures: []
|
|
161
|
+
spriteCustomMetadata:
|
|
162
|
+
entries: []
|
|
163
|
+
nameFileIdTable:
|
|
164
|
+
Ellipse 3_0: 6168737785598421730
|
|
165
|
+
mipmapLimitGroupName:
|
|
166
|
+
pSDRemoveMatte: 0
|
|
167
|
+
userData:
|
|
168
|
+
assetBundleName:
|
|
169
|
+
assetBundleVariant:
|