app.hypergames.hypersdk 1.5.4 → 1.5.6
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 +14 -0
- package/Editor/Scripts/Tools/HyperGameModeMenu.cs +2 -1
- package/Editor/Scripts/Windows/HyperCoreSettingsWindow.cs +3 -2
- package/Editor/Scripts/Windows/HyperGameContentWindow.cs +3 -2
- package/Editor/Scripts/Windows/HyperSettingsWindow.cs +3 -63
- package/HyperLoader.unity +2 -2
- package/Runtime/Internal/Bootstrap/HyperLoader.cs +50 -1
- package/Runtime/Internal/Core/HyperRuntime.cs +52 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
## [1.5.6](https://github.com/mvmhyper/hyper-sdk/compare/v1.5.5...v1.5.6) (2026-02-26)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* Runtime resource loading prioritizes configured Assets copy over package template ([ec8d523](https://github.com/mvmhyper/hyper-sdk/commit/ec8d523ae9110d854e00572f2de5471721d63b45))
|
|
7
|
+
|
|
8
|
+
## [1.5.5](https://github.com/mvmhyper/hyper-sdk/compare/v1.5.4...v1.5.5) (2026-02-26)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* UPM - ensure Settings window and asset file stay in sync ([f8da040](https://github.com/mvmhyper/hyper-sdk/commit/f8da040b84f6f797f433f2c689f3a5f687009bdf))
|
|
14
|
+
|
|
1
15
|
## [1.5.4](https://github.com/mvmhyper/hyper-sdk/compare/v1.5.3...v1.5.4) (2026-02-24)
|
|
2
16
|
|
|
3
17
|
|
|
@@ -19,7 +19,8 @@ namespace Hyper.Editor
|
|
|
19
19
|
private static bool TryLoadSettings(out HyperSDKSettings s)
|
|
20
20
|
{
|
|
21
21
|
if (_settings == null)
|
|
22
|
-
|
|
22
|
+
// Always load from Assets folder, not package (ensures we edit the editable copy)
|
|
23
|
+
_settings = AssetDatabase.LoadAssetAtPath<HyperSDKSettings>(HyperConstants.SETTINGS_ASSET_PATH);
|
|
23
24
|
s = _settings;
|
|
24
25
|
return s != null;
|
|
25
26
|
}
|
|
@@ -55,7 +55,8 @@ namespace Hyper.Editor
|
|
|
55
55
|
|
|
56
56
|
private void LoadSettings()
|
|
57
57
|
{
|
|
58
|
-
|
|
58
|
+
// Always load from Assets folder, not package (ensures we edit the editable copy)
|
|
59
|
+
_settings = AssetDatabase.LoadAssetAtPath<HyperSDKSettings>(HyperConstants.SETTINGS_ASSET_PATH);
|
|
59
60
|
|
|
60
61
|
if (_settings != null)
|
|
61
62
|
{
|
|
@@ -63,7 +64,7 @@ namespace Hyper.Editor
|
|
|
63
64
|
}
|
|
64
65
|
else
|
|
65
66
|
{
|
|
66
|
-
HyperDebug.LogWarning("Core settings not found in
|
|
67
|
+
HyperDebug.LogWarning("Core settings not found in Assets folder");
|
|
67
68
|
}
|
|
68
69
|
}
|
|
69
70
|
|
|
@@ -53,7 +53,8 @@ namespace Hyper.Editor
|
|
|
53
53
|
|
|
54
54
|
private void LoadSettings()
|
|
55
55
|
{
|
|
56
|
-
|
|
56
|
+
// Always load from Assets folder, not package (ensures we edit the editable copy)
|
|
57
|
+
_contentConfig = AssetDatabase.LoadAssetAtPath<HyperGameContentConfig>(HyperConstants.GAME_CONTENT_ASSET_PATH);
|
|
57
58
|
|
|
58
59
|
if (_contentConfig != null)
|
|
59
60
|
{
|
|
@@ -61,7 +62,7 @@ namespace Hyper.Editor
|
|
|
61
62
|
}
|
|
62
63
|
else
|
|
63
64
|
{
|
|
64
|
-
HyperDebug.LogWarning("Game content config not found in
|
|
65
|
+
HyperDebug.LogWarning("Game content config not found in Assets folder");
|
|
65
66
|
}
|
|
66
67
|
}
|
|
67
68
|
|
|
@@ -25,12 +25,11 @@ namespace Hyper.Editor
|
|
|
25
25
|
// Core Settings
|
|
26
26
|
private HyperSDKSettings _settings;
|
|
27
27
|
private UnityEditor.Editor _settingsEditor;
|
|
28
|
-
private double _lastSettingsModificationTime;
|
|
29
28
|
|
|
30
29
|
// Game Content
|
|
31
30
|
private HyperGameContentConfig _contentConfig;
|
|
32
31
|
private UnityEditor.Editor _contentEditor;
|
|
33
|
-
|
|
32
|
+
|
|
34
33
|
|
|
35
34
|
#endregion
|
|
36
35
|
|
|
@@ -70,17 +69,10 @@ namespace Hyper.Editor
|
|
|
70
69
|
private void OnEnable()
|
|
71
70
|
{
|
|
72
71
|
LoadAllSettings();
|
|
73
|
-
UpdateModificationTimes();
|
|
74
|
-
|
|
75
|
-
// Subscribe to asset modification events
|
|
76
|
-
EditorApplication.projectChanged += OnProjectChanged;
|
|
77
72
|
}
|
|
78
73
|
|
|
79
74
|
private void OnDisable()
|
|
80
75
|
{
|
|
81
|
-
// Unsubscribe from events
|
|
82
|
-
EditorApplication.projectChanged -= OnProjectChanged;
|
|
83
|
-
|
|
84
76
|
// Clean up editors
|
|
85
77
|
if (_settingsEditor != null)
|
|
86
78
|
{
|
|
@@ -101,8 +93,7 @@ namespace Hyper.Editor
|
|
|
101
93
|
|
|
102
94
|
private void LoadAllSettings()
|
|
103
95
|
{
|
|
104
|
-
|
|
105
|
-
_settings = Resources.Load<HyperSDKSettings>(HyperConstants.SETTINGS_RESOURCE_PATH);
|
|
96
|
+
_settings = AssetDatabase.LoadAssetAtPath<HyperSDKSettings>(HyperConstants.SETTINGS_ASSET_PATH);
|
|
106
97
|
if (_settings != null)
|
|
107
98
|
{
|
|
108
99
|
// Destroy old editor if it exists
|
|
@@ -113,8 +104,7 @@ namespace Hyper.Editor
|
|
|
113
104
|
_settingsEditor = UnityEditor.Editor.CreateEditor(_settings);
|
|
114
105
|
}
|
|
115
106
|
|
|
116
|
-
|
|
117
|
-
_contentConfig = Resources.Load<HyperGameContentConfig>(HyperConstants.GAME_CONTENT_RESOURCE_PATH);
|
|
107
|
+
_contentConfig = AssetDatabase.LoadAssetAtPath<HyperGameContentConfig>(HyperConstants.GAME_CONTENT_ASSET_PATH);
|
|
118
108
|
if (_contentConfig != null)
|
|
119
109
|
{
|
|
120
110
|
// Destroy old editor if it exists
|
|
@@ -126,54 +116,6 @@ namespace Hyper.Editor
|
|
|
126
116
|
}
|
|
127
117
|
}
|
|
128
118
|
|
|
129
|
-
private void UpdateModificationTimes()
|
|
130
|
-
{
|
|
131
|
-
// Update modification times for both assets
|
|
132
|
-
if (System.IO.File.Exists(HyperConstants.SETTINGS_ASSET_PATH))
|
|
133
|
-
{
|
|
134
|
-
_lastSettingsModificationTime = System.IO.File.GetLastWriteTime(HyperConstants.SETTINGS_ASSET_PATH).ToFileTime();
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
if (System.IO.File.Exists(HyperConstants.GAME_CONTENT_ASSET_PATH))
|
|
138
|
-
{
|
|
139
|
-
_lastContentModificationTime = System.IO.File.GetLastWriteTime(HyperConstants.GAME_CONTENT_ASSET_PATH).ToFileTime();
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
private void OnProjectChanged()
|
|
144
|
-
{
|
|
145
|
-
// Check if our assets were modified externally
|
|
146
|
-
bool settingsChanged = false;
|
|
147
|
-
bool contentChanged = false;
|
|
148
|
-
|
|
149
|
-
if (System.IO.File.Exists(HyperConstants.SETTINGS_ASSET_PATH))
|
|
150
|
-
{
|
|
151
|
-
var currentTime = System.IO.File.GetLastWriteTime(HyperConstants.SETTINGS_ASSET_PATH).ToFileTime();
|
|
152
|
-
if (currentTime != _lastSettingsModificationTime)
|
|
153
|
-
{
|
|
154
|
-
settingsChanged = true;
|
|
155
|
-
_lastSettingsModificationTime = currentTime;
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
if (System.IO.File.Exists(HyperConstants.GAME_CONTENT_ASSET_PATH))
|
|
160
|
-
{
|
|
161
|
-
var currentTime = System.IO.File.GetLastWriteTime(HyperConstants.GAME_CONTENT_ASSET_PATH).ToFileTime();
|
|
162
|
-
if (currentTime != _lastContentModificationTime)
|
|
163
|
-
{
|
|
164
|
-
contentChanged = true;
|
|
165
|
-
_lastContentModificationTime = currentTime;
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
// Reload if changes detected
|
|
170
|
-
if (settingsChanged || contentChanged)
|
|
171
|
-
{
|
|
172
|
-
LoadAllSettings();
|
|
173
|
-
UpdateModificationTimes();
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
|
|
177
119
|
private void CreateSettingsAsset()
|
|
178
120
|
{
|
|
179
121
|
EnsureResourcesFolderExists();
|
|
@@ -289,7 +231,6 @@ namespace Hyper.Editor
|
|
|
289
231
|
{
|
|
290
232
|
EditorUtility.SetDirty(_settings);
|
|
291
233
|
AssetDatabase.SaveAssets();
|
|
292
|
-
UpdateModificationTimes();
|
|
293
234
|
}
|
|
294
235
|
}
|
|
295
236
|
|
|
@@ -326,7 +267,6 @@ namespace Hyper.Editor
|
|
|
326
267
|
{
|
|
327
268
|
EditorUtility.SetDirty(_contentConfig);
|
|
328
269
|
AssetDatabase.SaveAssets();
|
|
329
|
-
UpdateModificationTimes();
|
|
330
270
|
}
|
|
331
271
|
}
|
|
332
272
|
|
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:
|
|
307
|
+
m_AnchoredPosition: {x: 489.28683, 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
|
|
@@ -1092,7 +1092,7 @@ RectTransform:
|
|
|
1092
1092
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
|
1093
1093
|
m_AnchorMin: {x: 0, y: 1}
|
|
1094
1094
|
m_AnchorMax: {x: 0, y: 1}
|
|
1095
|
-
m_AnchoredPosition: {x:
|
|
1095
|
+
m_AnchoredPosition: {x: 489.28683, y: -133.2274}
|
|
1096
1096
|
m_SizeDelta: {x: 875, y: 54.5378}
|
|
1097
1097
|
m_Pivot: {x: 0.5, y: 0.5}
|
|
1098
1098
|
--- !u!1 &2874543288936963705
|
|
@@ -92,7 +92,8 @@ namespace Hyper.Internal
|
|
|
92
92
|
|
|
93
93
|
private void LoadConfiguration()
|
|
94
94
|
{
|
|
95
|
-
|
|
95
|
+
// Load game content - prioritize Assets folder over package Resources
|
|
96
|
+
_gameContentConfig = LoadResourceFromAssets<HyperGameContentConfig>("HyperGameContentConfig");
|
|
96
97
|
if (_gameContentConfig == null)
|
|
97
98
|
{
|
|
98
99
|
HyperDebug.LogError("HyperGameContentConfig.asset not found in resources");
|
|
@@ -103,6 +104,54 @@ namespace Hyper.Internal
|
|
|
103
104
|
_hintWaitInstruction = new WaitForSecondsRealtime(_gameContentConfig.HintSwitchTimeInSeconds);
|
|
104
105
|
}
|
|
105
106
|
|
|
107
|
+
/// <summary>
|
|
108
|
+
/// Loads a resource from Resources, prioritizing Assets folder over package Resources.
|
|
109
|
+
/// Uses Resources.LoadAll to find all instances, then selects the configured one (non-empty) if multiple exist.
|
|
110
|
+
/// </summary>
|
|
111
|
+
private static T LoadResourceFromAssets<T>(string resourceName) where T : UnityEngine.Object
|
|
112
|
+
{
|
|
113
|
+
T[] allResources = Resources.LoadAll<T>(string.Empty);
|
|
114
|
+
|
|
115
|
+
if (allResources == null || allResources.Length == 0)
|
|
116
|
+
{
|
|
117
|
+
return Resources.Load<T>(resourceName);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
System.Collections.Generic.List<T> matchingResources = new System.Collections.Generic.List<T>();
|
|
121
|
+
foreach (T resource in allResources)
|
|
122
|
+
{
|
|
123
|
+
if (resource != null && resource.name == resourceName)
|
|
124
|
+
{
|
|
125
|
+
matchingResources.Add(resource);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
if (matchingResources.Count == 0)
|
|
130
|
+
{
|
|
131
|
+
return Resources.Load<T>(resourceName);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
if (matchingResources.Count == 1)
|
|
135
|
+
{
|
|
136
|
+
return matchingResources[0];
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
if (typeof(T) == typeof(HyperGameContentConfig))
|
|
140
|
+
{
|
|
141
|
+
for (int i = 0; i < matchingResources.Count; i++)
|
|
142
|
+
{
|
|
143
|
+
var config = matchingResources[i] as HyperGameContentConfig;
|
|
144
|
+
if (config != null && config.GameScene != null && config.GameScene.IsValid)
|
|
145
|
+
{
|
|
146
|
+
return matchingResources[i];
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
return matchingResources.Count > 1 ? matchingResources[1] : matchingResources[0];
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
return matchingResources.Count > 1 ? matchingResources[1] : matchingResources[0];
|
|
153
|
+
}
|
|
154
|
+
|
|
106
155
|
#endregion
|
|
107
156
|
|
|
108
157
|
#region Splash Screen Setup
|
|
@@ -176,19 +176,69 @@ namespace Hyper.Internal
|
|
|
176
176
|
|
|
177
177
|
private static void LoadSettings()
|
|
178
178
|
{
|
|
179
|
-
|
|
179
|
+
// Load settings - prioritize Assets folder over package Resources
|
|
180
|
+
_settings = LoadResourceFromAssets<HyperSDKSettings>("HyperSDKSettings");
|
|
180
181
|
if (_settings == null)
|
|
181
182
|
{
|
|
182
183
|
HyperDebug.LogError("Failed to load HyperSDKSettings");
|
|
183
184
|
}
|
|
184
185
|
|
|
185
|
-
|
|
186
|
+
// Load game content - prioritize Assets folder over package Resources
|
|
187
|
+
_gameContent = LoadResourceFromAssets<HyperGameContentConfig>("HyperGameContentConfig");
|
|
186
188
|
if (_gameContent == null)
|
|
187
189
|
{
|
|
188
190
|
HyperDebug.LogError("Failed to load HyperGameContentConfig");
|
|
189
191
|
}
|
|
190
192
|
}
|
|
191
193
|
|
|
194
|
+
/// <summary>
|
|
195
|
+
/// Loads a resource from Resources, prioritizing Assets folder over package Resources.
|
|
196
|
+
/// Uses Resources.LoadAll to find all instances, then selects the configured one (non-empty) if multiple exist.
|
|
197
|
+
/// </summary>
|
|
198
|
+
private static T LoadResourceFromAssets<T>(string resourceName) where T : UnityEngine.Object
|
|
199
|
+
{
|
|
200
|
+
T[] allResources = Resources.LoadAll<T>(string.Empty);
|
|
201
|
+
|
|
202
|
+
if (allResources == null || allResources.Length == 0)
|
|
203
|
+
{
|
|
204
|
+
return Resources.Load<T>(resourceName);
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
System.Collections.Generic.List<T> matchingResources = new System.Collections.Generic.List<T>();
|
|
208
|
+
foreach (T resource in allResources)
|
|
209
|
+
{
|
|
210
|
+
if (resource != null && resource.name == resourceName)
|
|
211
|
+
{
|
|
212
|
+
matchingResources.Add(resource);
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
if (matchingResources.Count == 0)
|
|
217
|
+
{
|
|
218
|
+
return Resources.Load<T>(resourceName);
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
if (matchingResources.Count == 1)
|
|
222
|
+
{
|
|
223
|
+
return matchingResources[0];
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
if (typeof(T) == typeof(HyperGameContentConfig))
|
|
227
|
+
{
|
|
228
|
+
for (int i = 0; i < matchingResources.Count; i++)
|
|
229
|
+
{
|
|
230
|
+
var config = matchingResources[i] as HyperGameContentConfig;
|
|
231
|
+
if (config != null && config.GameScene != null && config.GameScene.IsValid)
|
|
232
|
+
{
|
|
233
|
+
return matchingResources[i];
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
return matchingResources.Count > 1 ? matchingResources[1] : matchingResources[0];
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
return matchingResources.Count > 1 ? matchingResources[1] : matchingResources[0];
|
|
240
|
+
}
|
|
241
|
+
|
|
192
242
|
private static void InitializeModules()
|
|
193
243
|
{
|
|
194
244
|
_eventManager = _singletonObject.AddComponent<EventManager>();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "app.hypergames.hypersdk",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.6",
|
|
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",
|